Chapter 12

Dependency Injection

What's In This Chapter?

  • Software design patterns
  • Using the dependency resolver in MVC
  • Using the dependency resolver in Web API

As of version 3, ASP.NET MVC has included a dependency resolver that dramatically improves the ability of an application to participate in dependency injection for both services consumed by MVC and commonly created classes like controllers and view pages.

To understand how the dependency resolver works, we first need to define some of the common software patterns that it uses. If you're already familiar with patterns like service location and dependency injection, you may want to skim or skip the next section and go directly to the “Dependency Resolution in MVC” section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset