mercredi 30 août 2017

Cast object from PropertyInfo.GetValue to the type returned by PropertyInfo.GetType

As described in the title, I would like to be able to get the actual object referenced by a PropertyInfo to be passed to a generic method.

I've tried Convert.ChangeType(propInfo.GetValue(baseObj, null), propInfo.GetType() with no luck, is there any way to do this?





Aucun commentaire:

Enregistrer un commentaire