I have three classes,namely ClassA
,ClassB
,ClassC
.
ClassC inherits from ClassB,and ClassB inherits from ClassA.They are not static classes.
ClassC has a unique property,let it be "Name",which is not inherited from class B or C.
Suppose I create an instance of ClassC,namely instanceOfClassC:
ClassC instanceOfClassC = new ClassC();
instanceOfClassC.Name = "name of class";
Then I create an instance of ClassA and assign instanceOfClassC to it:
ClassA instanceofClassA = instanceOfClassC;
Then my question is: Is it possible to get "name of class" from instanceOfClassA? I've read this and this,but still haven't lost my heart. I'm writing a Converter, so I hope to get a solution without redesigning my classes.