我正在尝试查找类型集合是否IEnumerable
包含属性。
假设RowModels
是类型的集合IEnumerable
,我有......
foreach (var items in RowModels) {
if (items.GetType()
.GetProperties()
.Contains(items.GetType().GetProperty("TRId").Name) )
{
// do something...
}
}
我得到错误
System.Reflection.PropertyInfo[] does not contain a definition for 'Contains'
and the best extension method overload has some invalid arguments.