028.NET5_Autofac通过类支持AOP

Autofac通过类支持AOP-2

EnableInterfaceInterceptors+抽象标记特性[Intercept(typeof(CustomAutofacAop))],只要是实现了这个抽象就可以支持AOP

 EnableClassInterceptors+实现类标记特性[Intercept(typeof(CustomAutofacAop))],只要是实现了这个抽象就可以支持AOP

  如果使用了EnableClassInterceptors来支持AOP,实现类中支持AOP的方法必须为虚方法;

 

原文地址:https://www.cnblogs.com/ljg3020/p/14427853.html