📅  最后修改于: 2022-03-11 14:48:57.810000             🧑  作者: Mango
private static Expression> GetGroupKey(string property)
{
var parameter = Expression.Parameter(typeof(Menu));
var body = Expression.Property(parameter, property);
return Expression.Lambda>(body, parameter);
}
// Usage
context.Menus.GroupBy(GetGroupKey(columnName));