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 ...
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 ...
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:
...
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 ...
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 ...
2
votes
Accepted
ASP.NET Identity 2.0 UserManager alongside with UnitOfWork and Service-Locator anti-pattern
First, avoid .Result within async methods
...
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 ...
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 ...
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 ...
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 ...
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 <...
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] ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
asp.net-mvc-5 × 52c# × 48
asp.net-mvc × 10
razor × 10
entity-framework × 7
mvc × 6
asp.net × 6
javascript × 4
performance × 3
beginner × 3
authentication × 3
unit-testing × 2
linq × 2
sql-server × 2
api × 2
repository × 2
asp.net-web-api × 2
asp.net-identity × 2
jquery × 1
sql × 1
reinventing-the-wheel × 1
comparative-review × 1
json × 1
security × 1
web-scraping × 1