Exemple #1
0
 public SortOrderSpec(SortOrderSpec parent = null)
 {
     if (parent != null)
     {
         Expressions.AddRange(parent.Expressions);
     }
 }
Exemple #2
0
        internal QuerySpec CreateQuerySpec(FilterSpec filter, ScalarSpec scalarSpec = null, int? skip = null, int? take = null, SortOrderSpec sortSpec = null)
        {
            if (DataProvider.SupportsQueryTranslation())
                return DataProvider.CreateQuerySpec(filter, scalarSpec, sortSpec, skip, take, Schema);

            var querySpec = new QuerySpec(new CodeQuerySpec(), null);

            var codeQuerySpec = (CodeQuerySpec) querySpec.Code;

            if (filter != null)
                foreach (var expression in filter.Expressions)
                    codeQuerySpec.AddFilter(Schema, expression);

            if (sortSpec != null)
                foreach (var expression in sortSpec.Expressions)
                    codeQuerySpec.AddSort(Schema, expression.Expression, expression.SortOrder);

            if (scalarSpec != null)
                codeQuerySpec.AddScalar(Schema, scalarSpec.Expression);

            codeQuerySpec.Skip = skip;
            codeQuerySpec.Take = take;

            return querySpec;
        }
Exemple #3
0
 public QuerySpec CreateQuerySpec(FilterSpec filter, ScalarSpec expression, SortOrderSpec sortOrder, int? skip, int? take, OrmSchema schema)
 {
     throw new NotSupportedException();
 }
Exemple #4
0
 public SortOrderSpec(QueryExpression queryExpression, SortOrder sortOrder, SortOrderSpec parent = null)
     : this(parent)
 {
     if (queryExpression != null)
         Expressions.Add(new ExpressionWithSortOrder(queryExpression, sortOrder));
 }
Exemple #5
0
 public SortOrderSpec(LambdaExpression lambda, SortOrder sortOrder, SortOrderSpec parent = null)
     : this(parent)
 {
     if (lambda != null)
         Expressions.Add(new ExpressionWithSortOrder(new LambdaQueryExpression(lambda), sortOrder));
 }