How to construct Order By Expression dynamically in Entity Framework? [duplicate]
I found a solution with the help of Jon Skeet‘s old answer. public static class QueryHelper { private static readonly MethodInfo OrderByMethod = typeof (Queryable).GetMethods().Single(method => method.Name == “OrderBy” && method.GetParameters().Length == 2); private static readonly MethodInfo OrderByDescendingMethod = typeof (Queryable).GetMethods().Single(method => method.Name == “OrderByDescending” && method.GetParameters().Length == 2); public static bool PropertyExists<T>(this IQueryable<T> source, … Read more