Check out example codes for "dynamic group by expression C#". It will help you in understanding the concepts better.
Code Example 1
private static Expression<Func<Menu, string>> GetGroupKey(string property)
{
var parameter = Expression.Parameter(typeof(Menu));
var body = Expression.Property(parameter, property);
return Expression.Lambda<Func<Menu, string>>(body, parameter);
}
// Usage
context.Menus.GroupBy(GetGroupKey(columnName));
Learn ReactJs, React Native from akashmittal.com