3
Answers

Getting all properties of an object

Yash

Yash

17y
2.1k
1

Hi friends,

        Getting straight to the question....

        I understand that I can access property  like

       objA.Prop1.....through reflection as,

        Type myType = objA.GetType();

           PropertyInfo myProperty = myType.GetProperty("Prop1");

 But suppose I want to access property like

      objA.Prop1.Prop2 ...then how to retrive that value and also how to set that using reflection.

Thanks !!

Answers (3)