1、定义自定义特性类型,需要引用System.Attribute
![](https://img.haomeiwen.com/i13423228/47166c0d961a965e.png)
2、属性扩展方法
![](https://img.haomeiwen.com/i13423228/b0eb40de3668938d.png)
3、扩展方法调用方法
![](https://img.haomeiwen.com/i13423228/42b312d618356aa6.png)
读取代码:var dinfos= typeof(SomeClass).ReadPropertyInfos();
1、定义自定义特性类型,需要引用System.Attribute
2、属性扩展方法
3、扩展方法调用方法
读取代码:var dinfos= typeof(SomeClass).ReadPropertyInfos();
本文标题:【CSharp】读取类型里的自定义特性
本文链接:https://www.haomeiwen.com/subject/qnnfektx.html
网友评论