Unity Container and Support for dotnet Core / netstandard [closed]

坚强是说给别人听的谎言 提交于 2019-12-01 01:25:30

问题


So MS dropped (free sourced) Unity. Future of Unity
The github repository appears inactive Unity on GitHub

Anybody know what is going on with Unity ?
Is there a IOC Dependency Injection tool for dotNet Core, if Unity is a dead end under dotnet core?

EDIT: Still waiting on news about Unity.
Alternatives for those searching: StructureMap , AutoFac
or our selection , SimpleInjector It very active on GitHub. There are many downloads daily already ~1Million from Nuget alone. And its fast, very well documented, a nice API with good extensibility. Microsoft.Extensions.DependencyInjection would have been the next choice. We dont have ASP.NET project, If you do then definitely look at MS DI. You can use MS DI in DotNet Core too,
I like SimpleInjector more. The docu is good, with over 500 downloads a day and more than 1 million in total, Simpleinjector has gone past critical mass.

EDIT2: Unity might just do a phoenix for .netcore. It is still kicking.
See Unity for .netStandard discussion on github. Although there isnt a great deal of activity yet. There is at least some support to get it working on Core. The question is will it be too little too late? Late migrators may still benefit. For now (2018) it still looks like alternatives are requried.
SimpleInjector is on making solid progress as a legitimate replacement.
See SimpleInjector Nuget page. Nearly 3 million downloads and >1k per day. As of June 2018.


回答1:


For net core you can find a nice tutorial about Dependency Injection:

https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection or https://blogs.msdn.microsoft.com/webdev/2016/03/28/dependency-injection-in-asp-net-core/

Imho, implementing and using the Microsoft.Extensions.DependencyInjection is much easier, too. (At least for MVC-Web-Applications) you don't need unity anymore.



来源:https://stackoverflow.com/questions/42722926/unity-container-and-support-for-dotnet-core-netstandard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!