Given a property in a class, with attributes - what is the fastest way to determine if it contains a given attribute? For example:
[IsNotNullable]
[I
This is a pretty old question but I used
My method has this parameter but it could be built:
Expression> expression
Then in the method this:
System.Linq.Expressions.MemberExpression memberExpression
= expression.Body as System.Linq.Expressions.MemberExpression;
Boolean hasIdentityAttr = System.Attribute
.IsDefined(memberExpression.Member, typeof(IsIdentity));