Hi,
I have a public static property in a class. The class has some custom attributes applied to it. I want to access the Attribute in a static property.
In a non-static member I can get the type of current class using this.GetType() but how do I do this in a static member of the class ?
Please note that..
I do not want to use typeof(typename) due to inheritance issues. [I will have this property inherited to derived classes.].
I also do not want to use Generics as well.
EDIT
Here's my objective.
I have an abstract base class called EntityBase. All my entities derive from this class. Each entity also carries a custom attribute called TableMappingAttribute that lets me know the table it refers/maps to, during runtime. I already have a property in EntityBase that returns me the mapped TableName for the entity.
I will always need an instance of entity to access the TableName property. I wish to access this property statically sometime, like MyEntity.TableName. I have large amount entities in my project. I want this static property to be added in EntityBase class itself. So I must discover the type at runtime. How do I do this in EntityBase class itself ??
Thnaks.