问题
My code receives transparent proxy instead of original instance.
While this var type = obj.GetType();
yields the type of original class,
the following code throws TargetException
:
Object does not match target type
var value = property.GetValue(obj, null);
where property
is one from the type.GetProperties()
来源:https://stackoverflow.com/questions/42147889/how-to-get-the-value-of-the-property-of-a-transparent-proxy-via-reflection