1
我想检查propertyInfo以确定XmlIgnore
属性是否应用于给定属性。我怎样才能做到这一点?在C#中,如何检查XmlIgnore属性是否应用于属性?
我想检查propertyInfo以确定XmlIgnore
属性是否应用于给定属性。我怎样才能做到这一点?在C#中,如何检查XmlIgnore属性是否应用于属性?
bool b = type.GetProperty("MyProp")
.GetCustomAttributes(false)
.Any(a => a is XmlIgnoreAttribute);
typeof(string).GetProperty("Length").GetCustomAttributes(typeof(some attr))