ASP.NET MVC: Building for Productivity and Maintainability
2h 21mAdvanced2018-08-08
Authors

Jess Chadwick
Software Consultant
Course details
ASP.NET MVC provides great features and functionality out of the box, but there's more you can do to optimize your code. Learn how to build applications for long-term productivity and maintainability by streamlining your views, controllers, and models, in this deep dive course from Jess Chadwick. Discover how to separate application and business logic, reuse and simplify views, manage dependencies, reduce markup with HTML helpers, and apply patterns to increase productivity and simplify controller logic. Plus, learn how to take advantage of feature folders, which groups all necessary controllers, views, and models for a feature within a single folder, reducing navigation and search time and enabling feature scaling and code reuse.
Learning objectives
Creating separate projects for application and business logic
Customizing routes with attribute routing
Reusing views
Managing dependencies with dependency injection
Simplifying views
Reducing and reusing markup with HTML helpers
Creating view models to reduce view logic
Separating controllers and business logic
Simplifying controller logic with the Mediator pattern
Reorganizing to feature folders
Learning objectives
Creating separate projects for application and business logic
Customizing routes with attribute routing
Reusing views
Managing dependencies with dependency injection
Simplifying views
Reducing and reusing markup with HTML helpers
Creating view models to reduce view logic
Separating controllers and business logic
Simplifying controller logic with the Mediator pattern
Reorganizing to feature folders
Skills covered
ASP.NET MVCASP.NETC#Back-End Web DevelopmentFull-Stack Web DevelopmentFront-End Web DevelopmentWeb DevelopmentMicrosoftDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Improve the design of your ASP.NET MVC applications
- 02 - What you should know
- 03 - Using the exercise files
- 04 - Development environment setup
1. Going Beyond the Basics
- 05 - Differentiating the ASP.NET MVC framework and design pattern
- 06 - Examining your applications to find opportunities for improvement
- 07 - Creating separate projects for application and business logic
2. Quick Wins
- 08 - Enabling view compilation to detect errors at build time
- 09 - Reducing namespace references with global imports
- 10 - Customizing routes with attribute routing
- 11 - Reusing the same view for server-side and client-side rendering
- 12 - Better error logging with ELMAH
- 13 - Managing dependencies with dependency injection
3. Simplifying Your Views
- 14 - Using extension methods to remove magic strings
- 15 - Using extension methods to strongly type common actions
- 16 - Creating custom HTML helpers to reduce and reuse markup
- 17 - Using child actions to generate complex common markup
- 18 - Challenge - Use a child action to make a smarter HTML helper
- 19 - Solution - Use a child action to make a smarter HTML helper
4. Reducing View Logic with View Models
- 20 - Creating a view model to contain view logic
- 21 - Populating a view model with data
- 22 - Updating a view to use a view model
5. Separating Controllers and Business Logic
- 23 - Reducing duplicate code with custom action filters
- 24 - Creating explicit contracts with request objects
- 25 - Moving business logic from a controller to a service
- 26 - Consuming a service from a controller
- 27 - Challenge - Creating a model validation action filter
- 28 - Solution - Creating a model validation action filter
6. Simplifying Controller Logic with the Mediator Pattern
- 29 - Understanding the Mediator pattern
- 30 - Installing and configuring MediatR
- 31 - Creating the handler
- 32 - Consuming the handler in a controller
7. Reorganizing to Feature Folders
- 33 - Understanding the feature folders approach
- 34 - Creating feature folders
- 35 - Enabling location of feature views
Conclusion
- 36 - Next steps
Related courses
Related learn paths
- Advance your ASP.NET Developer skills
- Getting Started as an ASP.NET Developer
- Prepare for the MTA: Software Development Fundamentals Exam (98-361)
- Getting Started as an ASP.NET Core Developer
- Prepare for the Microsoft Azure Administrator (AZ-104) Exam
- Become a Back-End Web Developer
- Explore Web Development with Node.js
- Become a MEAN Javascript Developer