Exemplo n.º 1
0
        /// <inheritdoc/>
        public async Task <PagedResult <OrderRegistryItem> > Handle(GetOrderRegistryByFilterQuery query, CancellationToken cancellation)
        {
            int itemsCount = await _orderService.GetOrdersCountByRequestAsync(query.Request, cancellation);

            var orders = await _orderService.GetOrdersByRequestAsync(query.Request, cancellation);

            var items = _mapper.MapAsReadOnlyCollection <Domain.Entities.Order, OrderRegistryItem>(orders);

            return(new PagedResult <OrderRegistryItem>(itemsCount, items));
        }
        /// <inheritdoc/>
        public async Task <IReadOnlyCollection <ClientDto> > Handle(GetFilteredClientsQuery request, CancellationToken cancellation)
        {
            var clients = await _clientService.GetFilteredAsync(new ClientRequest { Name = request.SearchedString }, cancellation);

            return(_mapper.MapAsReadOnlyCollection <Domain.Entities.Client, ClientDto>(clients));
        }
        /// <inheritdoc/>
        public async Task <IReadOnlyCollection <EquipmentDto> > Handle(GetEquipmentByRequestQuery query, CancellationToken cancellation)
        {
            var equipments = await _equipmentService.GetByRequestAsync(query.Request, cancellation);

            return(_mapper.MapAsReadOnlyCollection <Domain.Entities.Equipment, EquipmentDto>(equipments));
        }