コード例 #1
0
 /// <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);
 }
コード例 #2
0
ファイル: SearchForm.cs プロジェクト: crazyants/QuerySearch
 /// <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);
 }
コード例 #3
0
        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)));
        }