How to create dependency injection for ASP.NET MVC 5?

前端 未结 9 1692
挽巷
挽巷 2020-12-23 03:08

Creating Dependency Injection with ASP.NET Core is fairly easy. The documentation explains it very well here and this guy has a killer video to explain it.

However,

9条回答
  •  礼貌的吻别
    2020-12-23 04:06

    I recommend you use Autofac, there are anothers fwk like unity, ninject, the benchmarks autofac has excelent perfomance.

    http://www.palmmedia.de/blog/2011/8/30/ioc-container-benchmark-performance-comparison

    Here is the integration with MVC (and works with all class)

    http://docs.autofac.org/en/latest/integration/mvc.html

提交回复
热议问题