c# - Property Name and need its value -
I have a property name and it must find its value within the class, what is the fastest way to do this ?
I'm assuming that you have the property name in the runtime; Not at the time of coding ...
Suppose your class is called The Class and its property is named:
Item GetThePropertyValue (object example) {type Type = example GetType (); Property Info Property INFO = type.GetProperty ("The Property"); Return Property INFO.GetValue (Example, Nil); }
Comments
Post a Comment