Hello,
Is there any way to get the custom attributes of a specific object I am receiving in a method?
I do not want nor can to iterate over Type.GetMembers() and search for my member. I have the object, which is also a member, that has the attribute.
How do I get the attribute?
class Custom
{
[Availability]
private object MyObject = "Hello";
private void Do(object o)
{
//does object 'o' has any custom attributes of type 'Availability'?
}
//somewhere I make the call: Do(MyObject)
}