After reading and writing code on Asp.Net MVC, I feel there are soo many ways we can improve our approach but few important best practices that we must follows are listed below.
- Security considerations
- Dependency Injection pattern
- Controllers must not interact with HttpContext, Data access classes, Configuration etc and never contain any logic
- Adopt PRG Pattern
- Verbs are important
- Create Extension methods of UrlHelper
- Avoid ViewData use ViewData.Model
- Html Helper extensions
- Always Encode
- Routing