コード例 #1
0
ファイル: RepositoryBase.cs プロジェクト: carlosga/DB
        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;
        }
コード例 #2
0
ファイル: MemoryDataProvider.cs プロジェクト: abrobston/DB
 public QuerySpec CreateQuerySpec(FilterSpec filter, ScalarSpec expression, SortOrderSpec sortOrder, int? skip, int? take, OrmSchema schema)
 {
     throw new NotSupportedException();
 }