I have a class called Recipes. It has properties that are other classes. So, for example, the name of the Fills property will be from the PDInt class, which has other properties about what I need.
If I want to set the value of the Fills property in the Prescription class, it will be something like
Prescription p = new Prescription(); p.Fills.Value = 33;
So now I want to take the name of the Fills property and add it to the tag property in the winform control.
this.txtFills.Tag = p.Fills.GetType().Name;
However, when I do this, I get the base class of the property, not the name of the property. So instead of getting "Fillings", I get "PDInt".
How to get the instance name of a property?
Thanks.
source share