I have:
class A
{
public object obj1 {get;set;}
public object obj2 {get;set;}
public object obj3 {get;set;}
}
Somewhere i have instance of obj2 for example. How can i get its name ("obj2") without using class A or instance A?
To do this without the instance of class A, you have to modify the type of your properties :
The only way is tracking the build process of class A, example:
You can't do this.
obj2
is the name of a property of the class A. So without using class A you cannot know its property names.