List<PropertyInfo> propertiesKeys = new List<PropertyInfo>();
foreach (string key in this.GroupProperyKeys)
{
PropertyInfo p = typeof(T).GetProperty(key);
if (p != null)
propertiesKeys.Add(p);
}
现在我想按给定的属性对列表进行分组。 如果我有一个属性要分组它看起来像这样
PropertyInfo keyProperty = typeof(T).GetProperty(this.GroupProperyKey);
if (keyProperty != null)
{
var group = m_list.GroupBy(x => keyProperty.GetValue(x));
}
是否可以按属性列表进行分组?
先谢谢你