public static Sql.IStringAggregate <string> OrderBy( [NotNull][ExprParameter] this Sql.IStringAggregateNotOrdered <string> aggregate) { if (aggregate == null) { throw new ArgumentNullException(nameof(aggregate)); } var query = aggregate.Query.Provider.CreateQuery <string>( Expression.Call( null, MethodHelper.GetMethodInfo(OrderBy, aggregate), Expression.Constant(aggregate) )); return(new Sql.StringAggregateNotOrderedImpl <string>(query)); }
public static Sql.IStringAggregateOrdered <T> OrderByDescending <T, TKey>( this Sql.IStringAggregateNotOrdered <T> aggregate, [ExprParameter] Expression <Func <T, TKey> > expr) { if (aggregate == null) { throw new ArgumentNullException(nameof(aggregate)); } if (expr == null) { throw new ArgumentNullException(nameof(expr)); } var query = aggregate.Query.Provider.CreateQuery <string>( Expression.Call( null, MethodHelper.GetMethodInfo(OrderByDescending, aggregate, expr), Expression.Constant(aggregate), Expression.Quote(expr))); return(new Sql.StringAggregateNotOrderedImpl <T>(query)); }