I have a class by 3 property.
class Issuance
{
[MyAttr]
virtual public long Code1 { get; set; }
[MyAttr]
virtual public long Code2 { get; set; }
virtual public long Code3 { get; set; }
}
I need to select some of properties in this class by my custom attribute([MyAttr]).
I use of GetProperties() But this return all properties.
var myList = new Issuance().GetType().GetProperties();
//Count of result is 3 (Code1,Code2,Code3) But count of expected is 2(Code1,Code2)
How can I do it?
Just use LINQ and a
Whereclause usingMemberInfo.IsDefined: