I have heard that in the next version of ASP.NET (ASP.NET vnext) there will be dependency injection built into the framework. Does anyone know more about this? Will it be unity or a new framework? Where can I find more information about this?
4 Answers
ASP.NET vNext will have built-in support for dependency injection. It is very basic support that currently supports only constructor injection.
The source repo for ASP.NET vNext's dependency injection logic contains sample implementations of how to wire up several community-built dependency injection systems, including Autofac, Ninject, StructureMap, Unity, and Castle Windsor. However, those are just samples and are not all complete or fully functional.
The idea is that for basic scenarios a developer can use the built-in DI, whereas people with more advanced requirements or if they already have a "favorite" DI system can plug that in instead and get richer features.
2 Comments
It will contain common abstractions for Autofac, Ninject, StructureMap, Unity, Windsor as seen here Dependency Injection github If you see in the Project.Json it has dependencies on these specific frameworks.
1 Comment
This blog explains the details on hov to wire up your own container: http://blogs.msdn.com/b/webdev/archive/2014/06/17/dependency-injection-in-asp-net-vnext.aspx