public SortOrderSpec(QueryExpression queryExpression, SortOrder sortOrder, SortOrderSpec parent = null) : this(parent) { if (queryExpression != null) { Expressions.Add(new ExpressionWithSortOrder(queryExpression, sortOrder)); } }
public SortOrderSpec(SortOrderSpec parent = null) { if (parent != null) { Expressions.AddRange(parent.Expressions); } }
public SortOrderSpec(LambdaExpression lambda, SortOrder sortOrder, SortOrderSpec parent = null) : this(parent) { if (lambda != null) { Expressions.Add(new ExpressionWithSortOrder(new LambdaQueryExpression(lambda), sortOrder)); } }
public QuerySpec CreateQuerySpec(FilterSpec filter, ScalarSpec expression, SortOrderSpec sortOrder, int?skip, int?take, TableSchema schema) { throw new NotSupportedException(); }
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); }