コード例 #1
0
ファイル: Sql.Strings.cs プロジェクト: to11mtm/linq2db
        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));
        }
コード例 #2
0
ファイル: Sql.Strings.cs プロジェクト: imattos78/linq2db
        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));
        }