0

I have List GroupProperyKeys and in my code I'm getting the Properties info

 List<PropertyInfo> propertiesKeys = new List<PropertyInfo>();
 foreach (string key in this.GroupProperyKeys)
 {
    PropertyInfo p = typeof(T).GetProperty(key);
    if (p != null)
      propertiesKeys.Add(p);
 }

now I want to group my list by the given properties. In case I have one property to group by it's look like this

PropertyInfo keyProperty = typeof(T).GetProperty(this.GroupProperyKey);
if (keyProperty != null)
{
   var group = m_list.GroupBy(x => keyProperty.GetValue(x));
}

Is it possible to group by list of properties?

Thank you in advanced

user3132295
  • 288
  • 4
  • 23

0 Answers0