Unity容器和对dotnet Core / netstandard的支持 [英] Unity Container and Support for dotnet Core / netstandard

查看:569
本文介绍了Unity容器和对dotnet Core / netstandard的支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此MS放弃了(免费)Unity。 团结的未来

github存储库显示为非活动在GitHub上保持统一

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

任何人都知道Unity发生了什么吗?

是否有一个IOC的dotNet Core依赖注入工具,如果Unity是dotnet核心下的死胡同,则
吗?

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?

编辑:仍在等待有关Unity的新闻。

搜索者的替代选择结构图 AutoFac

或我们的选择 SimpleInjector 在GitHub上非常活跃。每天从Nuget那里的下载量已经达到约100万。并且它的快速文档非常丰富,是一个具有良好扩展性的出色API。 Microsoft.Extensions.DependencyInjection 将是下一个选择。我们没有ASP.NET项目,如果您这样做的话,那么一定要关注MS DI。您也可以在DotNet Core中使用MS DI,

我更喜欢 SimpleInjector 。该文档非常好,每天有500多次下载,总下载量超过100万,Simpleinjector已经超过了临界质量。

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可能只是为.netcore制作了一个凤凰。

请参阅Unity的.netStandard讨论在github上尽管目前还没有很多活动。至少有一些支持可以使其在Core上运行。问题是太少太迟了吗?
较晚的移民仍可能受益。就目前而言(2018年)仍然似乎需要替代方案。

SimpleInjector正在进行合法替代的稳固进展。

请参阅SimpleInjector Nuget页面
每天近300万次下载,每天> 1k。截至2018年6月。

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.

推荐答案

对于网络核心,您可以找到有关依赖注入的不错的教程:

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

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

Imho,实现和使用 Microsoft.Extensions.DependencyInjection 也容易得多。 (至少对于MVC-Web-Applications),您不再需要统一。

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

这篇关于Unity容器和对dotnet Core / netstandard的支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆