30 November 2014

Dependency Injection made easy for ASP.Net MVC



If you need to implement dependency injection (DI) in your MVC.Net application, there is no easy way than using Unity Bootstrapper for ASP.NET MVC.

This is a lightweight dependency injection container which uses Microsoft Unity container. It is available as NuGet packeage. (https://www.nuget.org/packages/Unity.Mvc/)

Manage NuGet packages for you project and install, Unity Bootstrapper for ASP.NET MVC package.



The package installs some libraries to your project and you could also see the following two classes in your App_Start directory.




Lets get going. Just register your types in RegisterTypes method of UnityConfig and you are done!!





No comments:

Post a Comment