Introduction
Improve the design of your ASP.NET MVC applications
()
What you should know
()
Using the exercise files
()
Development environment setup
()
1. Going Beyond the Basics
Differentiating the ASP.NET MVC framework and design pattern
()
Examining your applications to find opportunities for improvement
()
Creating separate projects for application and business logic
()
2. Quick Wins
Enabling view compilation to detect errors at build time
()
Reducing namespace references with global imports
()
Customizing routes with attribute routing
()
Reusing the same view for server-side and client-side rendering
()
Better error logging with ELMAH
()
Managing dependencies with dependency injection
()
3. Simplifying Your Views
Using extension methods to remove magic strings
()
Using extension methods to strongly type common actions
()
Creating custom HTML helpers to reduce and reuse markup
()
Using child actions to generate complex common markup
()
Challenge: Use a child action to make a smarter HTML helper
()
Solution: Use a child action to make a smarter HTML helper
()
4. Reducing View Logic with View Models
Creating a view model to contain view logic
()
Populating a view model with data
()
Updating a view to use a view model
()
5. Separating Controllers and Business Logic
Reducing duplicate code with custom action filters
()
Creating explicit contracts with request objects
()
Moving business logic from a controller to a service
()
Consuming a service from a controller
()
Challenge: Creating a model validation action filter
()
Solution: Creating a model validation action filter
()
6. Simplifying Controller Logic with the Mediator Pattern
Understanding the Mediator pattern
()
Installing and configuring MediatR
()
Creating the handler
()
Consuming the handler in a controller
()
7. Reorganizing to Feature Folders
Understanding the feature folders approach
()
Creating feature folders
()
Enabling location of feature views
()
Ex_Files_ASP_NET_MVC_Productivity.zip
(22.5 MB)