I set to member of class attibute DataMember.
[DataMember]
internal protected string _FirstName="";
[DataMember]
public string FirstName { get { return _FirstName; }
internal protected set { _FirstName=(value!=null?value:""); } }
Next I want to search class members which have this attribute. But when I type:
Type.GetType("classType").GetProperty("FirstName").Attributes
I get null.
Any idea why this attribute was not found by reflection ?
You need to call
GetCustomAttributes, not use theAttributesproperty.