.Net优秀开源(2)Autofac
序言
IOC
Autofac
https://github.com/autofac/Autofac/tree/v6.0.0
builder.RegisterType<LocalConfigNodeCache>()
.As<ISoaNodeCache>()
.SingleInstance()
.AutoActivate();
AOP
AOP的实现方式大致可以分为两类:动态代理和IL编织两种方式
KingAop
https://github.com/AntyaDev/KingAOP
Couldn't load type 'KingAOP.AspectWeaver'
Because KingAOP is not avaible in nuget repository, I donwloaded github project, builded and add it as DLL library to my project.
Castle.Core
Castle.Core 本质是创建继承原来类的代理类,重写虚方法实现AOP功能。
https://github.com/castleproject/Core
Autofac.Aop
Autofac的AOP是通过Castle(也是一个容器)项目的核心部分实现的,名为Autofac.Extras.DynamicProxy,顾名思义,其实现方式为动态代理。
AutoMapper
https://github.com/AutoMapper/AutoMapper/tree/master
Dapper
https://github.com/DapperLib/Dapper/tree/main
资料
C#使用Autofac实现控制反转IoC和面向切面编程AOP
https://www.cnblogs.com/li150dan/category/1351056.html