示例#1
0
        public async Task <PagedResult <OrganizationDto> > Handle(GetOrganizationPagedListQuery request,
                                                                  CancellationToken cancellationToken)
        {
            var organization = _organizationRepository.GetAll().Where(x => x.IsDeleted == false);

            if (!string.IsNullOrWhiteSpace(request.Query))
            {
                organization = organization.Where(x => x.Name.Contains(request.Query) ||
                                                  x.Address.Contains(request.Query));
            }

            if (_currentUserService.RoleName == Role.Manager)
            {
                organization = organization.Where(x => x.Manager.Id == Guid.Parse(_currentUserService.UserId));
            }


            var organizationList = await _organizationRepository.BrowseAsync(organization, request);

            return(_mapper.Map <PagedResult <OrganizationDto> >(organizationList));
        }
示例#2
0
 public async Task <PagedResult <Order> > BrowseAsync(BrowseOrders query)
 => await _repository.BrowseAsync(o => o.CustomerId == query.CustomerId, query);
示例#3
0
 public async Task <PagedResult <Customer> > BrowseAsync(BrowseCustomers query)
 => await _repository.BrowseAsync(_ => true, query);
示例#4
0
 public async Task <IEnumerable <Flight> > BrowseAsync(int pageSize, int page)
 => await _collection.BrowseAsync(pageSize, page);
示例#5
0
 public async Task <PagedResult <Product> > BrowseAsync(BrowseProduct query)
 => await _repository.BrowseAsync(q => q.CategoryId == query.Id, query);
 public async Task <PagedResult <ProductCategory> > BrowseAsync(BrowseProductCategory query)
 => await _repository.BrowseAsync(q => q.Name != "", query);
示例#7
0
 public async Task <PagedResult <Document> > BrowseAsync(BrowseDocumentsByExternalId query)
 => await _repository.BrowseAsync(q => query.Ids.Contains(q.ExternalId), query);
示例#8
0
        public async Task <PagedResult <ContractDto> > Handle(MyContractQuery request, CancellationToken cancellationToken)
        {
            var contract = await _contractRepository.BrowseAsync(x => x.User.Id == Guid.Parse(_currentUser.UserId), request);

            return(_mapper.Map <PagedResult <ContractDto> >(contract));
        }
 public async Task <PagedResult <DomainEntities.Product> > BrowseAsync(BrowseProducts query)
 => await _repository.BrowseAsync(p => p.Category == query.Category, query);
 public async Task <PagedResult <Product> > BrowseAsync(BrowseProducts query)
 => await _repository.BrowseAsync(p =>
                                  p.Price >= query.PriceFrom && p.Price <= query.PriceTo, query);
示例#11
0
 public async Task <PagedResult <TodoItem> > BrowseTodosForUser(BrowseTodosForUser query) => await _repository.BrowseAsync(items => items.Id == query.Id, query);
 public async Task <PagedResult <TEntity> > BrowseAsync <TQuery>(Expression <Func <TEntity,
                                                                                   bool> > predicate, TQuery query) where TQuery : IPagedQuery
 => await _decoratedRepository.BrowseAsync(predicate, query);