/// <summary> /// Gets the sorting to be used. /// </summary> /// <returns></returns> public static IEnumerable <SortMemberAccess> GetSorting(this IPageForm form, ParameterExpression parameter) { if (!string.IsNullOrWhiteSpace(form.GetOrderBy())) { return(ExpressionHelper.CalculateSortMemberAccesses(parameter, form.GetOrderBy())); } return(null); }
/// <summary> /// Gets the sorting to be used. /// </summary> /// <returns></returns> public IEnumerable <SortMemberAccess> GetSorting(ParameterExpression parameter) { if (!string.IsNullOrWhiteSpace(OrderBy)) { return(ExpressionHelper.CalculateSortMemberAccesses(parameter, OrderBy)); } return(null); }
public static IQueryable <TEntity> OrderBy <TEntity>(this IQueryable <TEntity> query, string orderBy) { var parameter = Expression.Parameter(typeof(TEntity), "x"); return(OrderBy(query, parameter, ExpressionHelper.CalculateSortMemberAccesses(parameter, orderBy))); }