其他分享
首页 > 其他分享> > 034.NET5_Filter的多种注册和特点

034.NET5_Filter的多种注册和特点

作者:互联网

Filter的多种注册和扩展

1. [CustomActionFilter]  Filter必须有无参构造函数

2. [TypeFilter(typeof(CustomAcionFilterAttribute))] 可以没有无参构造函数,支持依赖注入

3. [ServiceFilter(typeof(CustomAcionFilterAttribute))] 可以没有无参构造函数,支持依赖注入,但要先注册服务

 

属性注入 

 

 

 

标签:无参,CustomAcionFilterAttribute,Filter,typeof,注册,NET5,034,构造函数
来源: https://www.cnblogs.com/ljg3020/p/14494837.html