All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
1 answer
239 views

Building ASP.Net control from JSON Data

I am working project where I need to build ASP.net control base on JSON data. I am using this method below to get all the data into class. I as using FirstOrDefault ...
Jefferson's user avatar
  • 361
1 vote
1 answer
91 views

Decoupling of validation and data access in ASP.NET

I've been asigned to a project no dev has touched in a long time. It's an ASP.NET MVC 4 application. It appeared to be well coded, but had no testing and the database migration folder is not present. ...
Peter's user avatar
  • 165
2 votes
1 answer
610 views

Displaying all application errors in a view

I'm learning ASP.NET Core with MVC pattern and I didn't find anything useful related to this argument. Actually I'm looking ...
Charanoglu's user avatar
4 votes
4 answers
4k views

Find consecutive numbers and turn them into ranges

I have array int[] arr = { -2, 0, 1, 2, 3, 4, 5, 8, 9, 11, 13, 15, 18, 22, 25, 28, 29, 30 }; I need to write function that shows it as string and if numbers are ...
Balance's user avatar
  • 61
2 votes
1 answer
89 views

IsDatabaseUp returns true or throws exception

I want to write an ASP.NET Web API endpoint that allows clients to check if database is running. The method below is check if database is up by establishing a connection and running a dummy sql ...
Pingpong's user avatar
  • 139
2 votes
0 answers
1k views

RESTful API combining three other APIs

I have created a RESTful API that uses three other APIs with Visual Studio 2017 in .NET Core. It is the first time I have ever programmed in .NET so I am sure the code could use a lot of improvements. ...
molundb's user avatar
  • 21
1 vote
1 answer
378 views

Calculating difference in time

In table first value I have value with datatype = Start I need to calculate difference first value - midnight Last value is ...
S.E's user avatar
  • 57
0 votes
3 answers
3k views

Repository with ViewModel (ASP.NET MVC)

I have db table Model. Here is code: ...
S.E's user avatar
  • 57
3 votes
1 answer
2k views

Implementing integration tests in ASP.NET core using InMemory database

I am building a web application using ASP.NET core. Most of the tests in my application are unit tests, so I mocked every dependencies in order to have fast unit tests. On the other hand I am of the ...
mirind4's user avatar
  • 299
1 vote
1 answer
41 views

Dual rewrite rules (WWW prefix and HTTPS)

I want to configure my website to force a www. prefix on the name, and the HTTPS protocol. ...
Jonathan Wood's user avatar
4 votes
2 answers
3k views

Log Visitor Count in Asp.net MVC

I have a table to Log visitor Count Like : ...
work question's user avatar
-1 votes
1 answer
4k views

ASP.NET MVC multi language website

What is the best way to make an ASP.NET MVC multi language website? The following code is what I use, but I need to make sure from your real-world experience that my code is the best way for ...
Alex's user avatar
  • 1
6 votes
2 answers
7k views

"Forgot password" functionality

I want to implement the "forgot password" functionality in Asp.Net MVC 5. Here is the code flow: Take user email ID Let the user enter the token received in his email inbox If the token matches then ...
Unbreakable's user avatar
1 vote
0 answers
2k views

ValidationAttribute to validate a string against a JSON schema

This is my implementation of an .NET ValidationAttribute to validate a string against a JSON schema. The JSON schema file is stored within the application as an ...
James Law's user avatar
  • 497
3 votes
1 answer
1k views

An Edit action in ASP.NET MVC, with handling for missing id parameter

I have a standard Edit action in Asp.Net MVC 5 and I want to avoid throwing the unhandled exception when is made a get request without the id like ~/food/edit, so I did this. ...
Pedro S Cord's user avatar
1 vote
3 answers
4k views

ASP.NET Product Listing

I am working on a e-shop in ASP.NET MVC, and I just made the listing of product the way I figured out this night. Is it correct? Or should I make it differently? How? So this is my Product controller,...
Marinaro's user avatar
10 votes
1 answer
184 views

ASP controller for tracking equipment

This was originally posted here. I'm hoping Code Review will be a little more helpful in giving me a concrete direction. I've been working on a project based off of this tutorial. Unfortunately, ...
J Hache's user avatar
  • 161
5 votes
1 answer
4k views

Recurring tasks in ASP.NET MVC

I have 2 alternatives for executing recurring tasks in ASP.NET MVC. We just need to add some code in Global.asax First alternative: ...
sDima's user avatar
  • 849
5 votes
1 answer
1k views

Combating magic strings in a web application

I'm on a quest to combat all the magic strings which tends to pile up in an ASP.NET MVC application. All reviews will be highly appreciate but please note that: Some of the classes contains more (...
Bjørn-Roger Kringsjå's user avatar
3 votes
3 answers
7k views

Master detail INSERT in Entity Framework 6 Database First MVC 5

I have a DB with a master table called "facturas" and another detail table "facturas_detalle." I would like to insert to them, so this is a "Database-First". I need some guidance or advise of best ...
Mr_LinDowsMac's user avatar
2 votes
2 answers
3k views

Basic survey app

I am learning MVC 5 .NET and this is a bit different than Rails activerecord when creating relations. I have created a basic survey app that has a Survey class and this relates to the questions and ...
thefenry's user avatar
1 vote
2 answers
311 views

Code separation in MVC

Firstly I am not a professional programmer and I am just learning C#, MVC and Web Development. Much of what I describe here is self taught and comes from lots of googling and posts on Stack Overflow. ...
cramar's user avatar
  • 11
1 vote
1 answer
784 views

Using ASP.NET identity in a new app

I need code review for using ASP.NET Identity in a new app. Goals: Use int instead of GUID for IDs. Separate identity from view layer I need code review if I did ...
1110's user avatar
  • 217
1 vote
1 answer
1k views

Dependency Injection With Unity in MVC 5 without repository and unit of work

I want to use dependency injection with Unity in my application. I am not following repository pattern and unit-of-work (and don't want to). I also have ViewModel in my controller action method. ...
koushik's user avatar
  • 121
3 votes
3 answers
585 views

Code optimization by constant if-structure iteration removal

Below you will find the specific code that I am attempting to optimize. I have a method previous to called getCount() which, based on similar parameters as below, ...
Bialy R Bert's user avatar
2 votes
2 answers
1k views

ASP.NET MVC website that display blogs from the database by AJAX

The problem is, I have to limit the results to only 10 by default and add a "Load More" button to display 10 more results each time when user click the button. But I'm worried about users having their ...
Anonymous's user avatar
  • 123
2 votes
1 answer
455 views

Is my ObjectCache wrapper sound?

Wrapper: ...
Stijn's user avatar
  • 323
5 votes
1 answer
3k views

Entity Framework, code-first repository pattern review. Where to validate?

I've been iterating on my repository pattern implementation over the course of the past 4-5 months. In my new projects I choose to use this pattern and I try to improve upon what I learned in previous ...
Ryan's user avatar
  • 151