1、定义自定义特性类型,需要引用System.Attribute

2、属性扩展方法

3、扩展方法调用方法

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