.NET Core下自带容器IServiceCollection以及AutoFac以及AutoFac中AOP简介
https://www.cnblogs.com/artech/p/net-core-di-01.html 大内老A的在.NET Core下对这些的介绍,有一系列文章 https://www.cnblogs.com/jesse2013/p/di-in-aspnetcore.html https://www.cnblogs.com/artech/p/dependency-injection-in-asp-net-core.html https://www.zybuluo.com/dasajia2lang/note/1481011 下面开始 在上一篇的笔记中,在.NET Freamwork中,有一个第三方容器Unity,可以实现注入,但是在.NET Core里面,有一个IServiceCollection,这个是.NET Core框架自带的一个容器,和Unity很相似,都是个容器。 下面我们新建一个控制台程序,在控制台程序中,对IServiceCollection的使用做介绍。 下面代码,是本次实例中需要注入的类型,需要用的倒是再点开来看吧 namespace Bingle . Core . Interface { public interface ITestServiceA { void Show (); } } namespace Bingle . Core . Service {