I want to check propertyInfo to determine whether or not XmlIgnore
attribute is applied to a given property. How can I do this?
bool b = type.GetProperty("MyProp")
.GetCustomAttributes(false)
.Any(a => a is XmlIgnoreAttribute);
typeof(string).GetProperty("Length").GetCustomAttributes(typeof(some attr))
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.