《B会场-李卫涵-探索Interceptor的魔力.pdf》由会员分享,可在线阅读,更多相关《B会场-李卫涵-探索Interceptor的魔力.pdf(24页珍藏版)》请在三个皮匠报告上搜索。
1、?Interceptor?WeihanLiiHerb?MVP/amazingdotnet?0202Why InterceptorWhy Interceptor0303How to use InterceptorHow to use Interceptor0404Minimal API AOTMinimal API AOTWhat?s InterceptorWhat?s Interceptor0101?AGENDAWhat?s InterceptorWhat?s InterceptorAn interceptor interceptor is a method which can declara
2、tively substitute a call to an interceptable method with a call to itself at compile time.?方法编译时声明式调用替换How it interceptsHow it interceptsThis substitution occurs by having the interceptor declare the source locations of the calls that it intercepts.?What happens when compileWhat happens when compile
3、Why InterceptorWhy InterceptorAOT性 能AOP临时测试How to implement an interceptorHow to implement an interceptorMust&LimitationMust&Limitation只拦截普通方法调用方法签名应一致只支持本地代码不支持类库内部调用只支持 C#不支持 VB定义在非泛型类型中Constructor构造方法Property属性Operator操作符Delegate委托Local Function本地函数Not SupportedNot SupportedIntercepts instance me
4、thodIntercepts instance methodIntercepts extension methodIntercepts extension methodMultiple InterceptionMultiple InterceptionSourceSource Generator IntegrationGenerator IntegrationSourceSource Generator IntegrationGenerator IntegrationSourceSource Generator IntegrationGenerator IntegrationSourceSou
5、rce Generator IntegrationGenerator IntegrationSourceSource Generator IntegrationGenerator IntegrationSourceSource Generator IntegrationGenerator IntegrationMinimal API AOTMinimal API AOTMinimal API AOTMinimal API AOTMinimal API AOTMinimal API AOTMinimal API AOTMinimal API AOTReferencesReferences https:/ https:/ https:/ https:/ https:/ https:/ https:/code- YouThank YouKeep CodingKeep Coding