internal ProjectionInnerBuilder(IStorageReader <TRootDataModel> storage,
                                 DataFilter <TRootDataModel> filter,
                                 DataLimiter <TRootDataModel> limiter,
                                 DataIncludes <TRootDataModel> includes)
     : base(storage, filter, limiter, includes)
 {
 }
 internal FluentQueryBuilderWithLimiterAndFilter(IStorageReader <TDataModel> storage,
                                                 DataFilter <TDataModel> filter,
                                                 DataLimiter <TDataModel> limiter,
                                                 DataIncludes <TDataModel> includes)
     : base(storage, filter, limiter, includes)
 {
 }
 public SiteControllerMethods(SiteQueries _dbQuery, AdminQueries _AdbQuery)
 {
     dbQuery       = _dbQuery;
     _dataLimiter  = new DataLimiter(_AdbQuery);
     authenticator = new SiteAuth(_AdbQuery, _dbQuery, _dataLimiter);
     validator     = new SiteCreationValidator(dbQuery);
 }
 internal FluentQueryBuilderWithLimiter(IStorageReader <TDataModel> storage,
                                        DataFilter <TDataModel> filter,
                                        DataLimiter <TDataModel> limiter,
                                        DataProjection <TDataModel, TGroup, TSelect> projection)
     : base(storage, filter, limiter, projection.GetDataIncludes())
 {
     _projection = projection;
 }
示例#5
0
 internal FluentQueryBuilderWithProjection(IStorageReader <TDataModel> storage,
                                           DataFilter <TDataModel> filter,
                                           DataLimiter <TDataModel> limiter,
                                           DataIncludes <TDataModel> includes,
                                           Expression <Func <TDataModel, TSelect> > select)
     : base(storage, filter, limiter, includes)
 {
     _projection = new DataProjection <TDataModel, TSelect>(includes._includes, select);
 }
示例#6
0
        public DataLimiterResult <TDataModel> LimitedSearch(DataReducer <TDataModel> reducer,
                                                            DataLimiter <TDataModel> limiter)
        {
            Checker.NotNullArgument(reducer, nameof(reducer));
            Checker.NotNullArgument(limiter, nameof(limiter));

            var result = QuerySearch(reducer);

            return(QueryLimitResult(limiter, result));
        }
        internal ProjectionRootBuilder(IStorageReader <TDataModel> storage,
                                       DataFilter <TDataModel> filter,
                                       DataLimiter <TDataModel> limiter,
                                       DataIncludes <TDataModel> includes,
                                       Expression <Func <TDataModel, TSelect> > select)
            : base(storage, filter, limiter, includes)
        {
            Checker.NotNullArgument(select, nameof(select));

            _select = select;
        }
        internal ProjectionInnerBuilder(IStorageReader <TRootDataModel> storage,
                                        DataFilter <TRootDataModel> filter,
                                        DataLimiter <TRootDataModel> limiter,
                                        DataIncludes <TRootDataModel> includes,
                                        Expression <Func <TRootDataModel, TGroup> > group,
                                        Expression <Func <IGrouping <TGroup, TRootDataModel>, TSelect> > select)
            : base(storage, filter, limiter, includes)
        {
            Checker.NotNullArgument(group, nameof(group));
            Checker.NotNullArgument(select, nameof(select));

            _group  = group;
            _select = select;
        }
        internal FluentQueryBuilderElements(
            IStorageReader <TDataModel> storage,
            DataFilter <TDataModel> filter,
            DataLimiter <TDataModel> limiter,
            DataIncludes <TDataModel> includes)
        {
            Checker.NotNullArgument(storage, nameof(storage));
            Checker.NotNullArgument(filter, nameof(filter));
            Checker.NotNullArgument(limiter, nameof(limiter));
            Checker.NotNullArgument(includes, nameof(includes));

            _storage  = storage;
            _filter   = filter;
            _limiter  = limiter;
            _includes = includes;
        }
示例#10
0
        private DataLimiterResult <TDataModel> QueryLimitResult(DataLimiter <TDataModel> limiter,
                                                                IQueryable <TDataModel> origin)
        {
            Checker.NotNullArgument(limiter, nameof(limiter));

            // Ensures offset range
            if (0 > limiter.OffsetBegin)
            {
                throw new ArgumentOutOfRangeException($"limiter.{limiter.OffsetBegin}");
            }

            if (0 > limiter.OffsetEnd)
            {
                throw new ArgumentOutOfRangeException($"limiter.{limiter.OffsetEnd}");
            }

            if (0 > limiter.OffsetEnd - limiter.OffsetBegin)
            {
                throw new ArgumentOutOfRangeException(
                          $"limiter.{limiter.OffsetEnd} - limiter.{limiter.OffsetBegin}");
            }

            var sorter = limiter.GetSorter();

            Checker.NotNullObject(sorter, $"limiter.{nameof(limiter.GetSorter)}()");

            var ordered = !limiter.Descending
                ? origin.OrderBy(sorter)
                : origin.OrderByDescending(sorter);

            var count  = ordered.Count();
            var result = ordered
                         .Skip(limiter.OffsetBegin)
                         .Take(limiter.OffsetEnd - limiter.OffsetBegin);

            return(new DataLimiterResult <TDataModel>(result, count));
        }
示例#11
0
 public DataLimiterResult <TDataModel> LimitedSearch(DataReducer <TDataModel> reducer,
                                                     DataLimiter <TDataModel> limiter) => _base.LimitedSearch(reducer, limiter);
示例#12
0
 public DataLimiterResult <TDataModel> Get(DataLimiter <TDataModel> limiter) => _base.Get(limiter);
示例#13
0
        public DataLimiterResult <TDataModel> Get(DataLimiter <TDataModel> limiter)
        {
            Checker.NotNullArgument(limiter, nameof(limiter));

            return(QueryLimitResult(limiter, Query));
        }
示例#14
0
 public SiteAuth(AdminQueries _dbQueryA, SiteQueries _dbQueryS, DataLimiter dataLimiter) : base(_dbQueryA)
 {
     dbQueryS     = _dbQueryS;
     _dataLimiter = dataLimiter;
 }