How do I read an attribute on a class at runtime?
- by Zaff
I am trying to create a generic method that will read an attribute on a class and return that value at runtime. How do would I do this?
Note: DomainName attribute is of class DomainNameAttribute.
[DomainName(“MyTable”)]
Public class MyClass : DomianBase
{}
What I am trying to generate:
//This should return “MyTable”
String DomainNameValue = GetDomainName<MyClass>();