Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

dynamic group by expression C#

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));
Comment

PREVIOUS NEXT
Code Example
Csharp :: click in vue 
Csharp :: c# close form 
Csharp :: c# convert enumb to int array 
Csharp :: c# add time to datetime 
Csharp :: convert int32 
Csharp :: unity toint 
Csharp :: how to create a variable in c# 
Csharp :: c# list.foreach 
Csharp :: pyautopgui erros 
Csharp :: create new .net core project visual studio 
Csharp :: c# set cursor to loading and back 
Csharp :: c# implement ienumerable t 
Csharp :: unity add button 
Csharp :: deserialize json to dynamic object c# 
Csharp :: convert number of days into months c# 
Csharp :: c# xml get child node by name 
Csharp :: replace multiple characters in string c# 
Csharp :: Get Last Access Time Of Directory C# 
Csharp :: c# string right extension 
Csharp :: c# chunk array linq 
Csharp :: c# get list object type of generic list 
Csharp :: how to display array in string in c# 
Csharp :: sum of digit of number c# 
Csharp :: longest substring without repeating characters leetcode 
Csharp :: c# get random index from list 
Csharp :: unity rb.addexplosionforce 2d 
Csharp :: c# bootstrap checkbox 
Csharp :: get position of another object unity 
Csharp :: how to set a tag in asp net razor view stackoverflow 
Csharp :: unity pickup and drop objects 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =