Exemplo n.º 1
0
        public RegionCollectionResponse Fetch(RegionQueryCollectionRequest request)
        {
            base.FixupLimitAndPagingOnRequest(request);

            var totalItemCount  = 0;
            var sortExpression  = RepositoryHelper.ConvertStringToSortExpression(EntityType, request.Sort);
            var includeFields   = RepositoryHelper.ConvertStringToExcludedIncludedFields(EntityType, request.Select);
            var prefetchPath    = RepositoryHelper.ConvertStringToPrefetchPath(EntityType, request.Include, request.Select);
            var predicateBucket = RepositoryHelper.ConvertStringToRelationPredicateBucket(EntityType, request.Filter, request.Relations);

            EntityCollection <RegionEntity> entities;

            using (var adapter = DataAccessAdapterFactory.NewDataAccessAdapter())
            {
                OnBeforeFetchRegionQueryCollectionRequest(adapter, request, sortExpression, includeFields, prefetchPath, predicateBucket,
                                                          request.PageNumber, request.PageSize, request.Limit);
                entities = base.Fetch(adapter, sortExpression, includeFields, prefetchPath, predicateBucket,
                                      request.PageNumber, request.PageSize, request.Limit, request.RCache, out totalItemCount);
                OnAfterFetchRegionQueryCollectionRequest(adapter, request, entities, sortExpression, includeFields, prefetchPath, predicateBucket,
                                                         request.PageNumber, request.PageSize, request.Limit, totalItemCount);
            }
            var response = new RegionCollectionResponse(entities.ToDtoCollection(), request.PageNumber,
                                                        request.PageSize, totalItemCount);

            return(response);
        }
Exemplo n.º 2
0
        /// <summary>Queries 'Region' entities using sorting, filtering, eager-loading, paging and more.</summary>
        public RegionCollectionResponse Get(RegionQueryCollectionRequest request)
        {
            OnBeforeGetRegionQueryCollectionRequest(request);
            var output = Repository.Fetch(request);

            OnAfterGetRegionQueryCollectionRequest(request, output);
            return(output);
        }
Exemplo n.º 3
0
 partial void OnAfterFetchRegionQueryCollectionRequest(IDataAccessAdapter adapter, RegionQueryCollectionRequest request, EntityCollection <RegionEntity> entities, SortExpression sortExpression, ExcludeIncludeFieldsList excludedIncludedFields, IPrefetchPath2 prefetchPath, IRelationPredicateBucket predicateBucket, int pageNumber, int pageSize, int limit, int totalItemCount);
Exemplo n.º 4
0
 partial void OnBeforeFetchRegionQueryCollectionRequest(IDataAccessAdapter adapter, RegionQueryCollectionRequest request, SortExpression sortExpression, ExcludeIncludeFieldsList excludedIncludedFields, IPrefetchPath2 prefetchPath, IRelationPredicateBucket predicateBucket, int pageNumber, int pageSize, int limit);
Exemplo n.º 5
0
 partial void OnAfterGetRegionQueryCollectionRequest(RegionQueryCollectionRequest request, RegionCollectionResponse response);
Exemplo n.º 6
0
 partial void OnBeforeGetRegionQueryCollectionRequest(RegionQueryCollectionRequest request);