如何通过reflection获取透明代理的属性值?
我的代码接收透明代理而不是原始实例。
虽然这个var type = obj.GetType();
产生原始类的类型,以下代码抛出TargetException
:
对象与目标类型不匹配
var value = property.GetValue(obj, null);
其中property
是type.GetProperties()
我的代码接收透明代理而不是原始实例。
虽然这个var type = obj.GetType();
产生原始类的类型,以下代码抛出TargetException
:
对象与目标类型不匹配
var value = property.GetValue(obj, null);
其中property
是type.GetProperties()