Hi there.
Is there a way to create LINQ query that will have different grouping fields. I.E. I have a class
public class Stat
{
public DateTime Date { get; set; }
public int ApplicationId { get; set; }
public int ActionType { get; set; }
public string Version { get; set; }
}
Now I need to query table with this data with grouping by several custom fields. For example, group by ApplicationId and ActionType or by Application and Version
I don't want to write different queries for all possible combinations of fields. And want to make a generic method, that will accept list on column names where grouping must occur.
So is there a way to create such a query in runtime?