Skip to main content
5 votes
Accepted

Multilingual website with a database

Too many Language Repetitions You use the "Language" key a lot. What if you decide to rename it sometime? You'll need to search ...
t3chb0t's user avatar
  • 44.7k
4 votes

Creating a simple unit of work with Entity Framework and no repository

I can be very short about this: Single responsibility: a controller shouldn't also have Unit of Work responsibilities. The context itself is the perfect Unit of Work. You don't always need ...
Gert Arnold's user avatar
  • 2,060
3 votes
Accepted

Caching lookup values in an e-commerce website

Global static state makes your code untestable... I would define your car make lookup as: ...
Dmitry Nogin's user avatar
  • 6,131
2 votes
Accepted

Display all files in a folder (object) along with nested subdirectories part 2

You should remove int dummyCounter = 1; and change the if's checking for ...
Heslacher's user avatar
  • 51k
2 votes
Accepted

Display all files in a folder (object) along with nested subdirectories

I have just two comments: The name dummyCounter is really terrible, you should find something more appropriate like currentDepth ...
t3chb0t's user avatar
  • 44.7k
2 votes
Accepted

ASP.NET Identity 2.0 UserManager alongside with UnitOfWork and Service-Locator anti-pattern

First, avoid .Result within async methods ...
Nkosi's user avatar
  • 3,296
2 votes

Member management of Active Directory groups via an ASP.NET MVC website

If I'm reading things right, then a simple solution would be to change the parameter of your Index action method from (string roleName) to ...
cjmorelock's user avatar
2 votes

Handing "Others" option in dropdown in ASP.Net MVC 5

Basically, I have hardcoded in database "Option 4" as a Company Named "Others". But I think that is bad approach. When I publish the app to live. That option 4 will not be there. I've run into this ...
Greg Burghardt's user avatar
2 votes

Entity Framework MVC updating db using a repository method

If your MyRepository class performs creation and disposal of the DbContext (MyEntities I assume) for every single operation, it ...
Dylan Nicholson's user avatar
1 vote

ASP.net service that sends email whenever an entity is updated

The very first problem is to move some responsibilities out of the controller. IMHO controllers should do as little as possible because their responsibility should be to glue the HTTP request to the ...
Adriano Repetti's user avatar
1 vote
Accepted

Making EmployeeHistory ViewModel immutable as code analysis suggested

Nulls: What happens when someone asks for an EmployeeHistory without passing in an employee ID? It's hard for me to believe that the API for retrieving history will behave well, must less the call to <...
benj2240's user avatar
  • 1,036
1 vote
Accepted

Handing "Others" option in dropdown in ASP.Net MVC 5

To address points 1, 2 and 4, You database should not include a value for "Others". Instead you can handle this one of 2 ways Option 1 Remove the [Required] ...
Stephen Muecke's user avatar
1 vote
Accepted

Display a dropdown based on another dropdown change

First to address the controller method your calling in the ajax function. Your currently returning a serialized collection of SelectListItem which means your ...
Stephen Muecke's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible