【发布时间】:2012-07-11 11:21:25
【问题描述】:
我有一个带有这样签名的方法
void RefreshMethod<T>(IEnumerable<T> lst, string propertyName) where T:class
{
Type type = typeof(T);
PropertyInfo property = type.GetProperties().Single(u => u.Name == primaryKeyProperty);
//query goes here
}
现在我想查询该集合以获取其所有值
属性名称
在一个简单的场景中,就这么简单
lst.where(u=>u.ID<0)
但这里我没有那个 ID 属性,但有相应的“PropertyInfo”对象。
我应该如何做到这一点。
请指导
【问题讨论】:
标签: c# linq reflection