Esempio n. 1
0
        public async Task <PagedResult <CustomerDto> > HandleAsync(BrowseCustomers query)
        {
            var pagedResult = await _customersRepository.BrowseAsync(query);

            var customers = pagedResult.Items.Select(c => new CustomerDto
            {
                Id        = c.Id,
                Email     = c.Email,
                FirstName = c.FirstName,
                LastName  = c.LastName,
                Address   = c.Address,
                Country   = c.Country,
                CreatedAt = c.CreatedAt,
                Completed = c.Completed
            });

            return(PagedResult <CustomerDto> .From(pagedResult, customers));
        }
 public async Task <IActionResult> Get([FromQuery] BrowseCustomers query)
 => Collection(await _repository.BrowseAsync(query));