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?
You can’t do this.
obj2is the name of a property of the class A. So without using class A you cannot know its property names.