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 關注
- 155 瀏覽
添加回答
舉報
0/150
提交
取消