propertyInfo.PropertyType它返回和之间的不同数据propertyInfo.GetType()。我想知道它有什么不同var propInfo = dataModel.GetProperty("List<string>");var test1 = propinfo.GetType().IsGenericType; // it returns false;var test2 = propinfo.PropertyType.IsGenericType; // it returns true;请给我一些想法。谢谢你。
1 回答
POPMUISE
TA贡献1765条经验 获得超5个赞
嗯,propertyInfo.PropertyType是propertyInfo对象所代表的属性的类型。这是typeof(List<string>)你的情况。另一方面,propertyInfo.GetType()是从 派生的类型 typeof(PropertyInfo)。
- 1 回答
- 0 关注
- 206 浏览
添加回答
举报
0/150
提交
取消
