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

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -