Esempio n. 1
0
        public async Task <IActionResult> GetAll([FromQuery] VendaRequestAllDto requestDto)
        {
            var lista = new ListDto <VendaDto>();

            try
            {
                var response = await _appService.GetAllVendaAsync(requestDto);
            }
            catch (Exception ex)
            {
                var v = new VendaDto()
                {
                    Id      = new Guid("0D4090B2-5687-4938-ABDF-A8DA016EE645"),
                    Product = new Dto.Product.ProductDto()
                    {
                        Id = new Guid("0D4090B2-5687-4938-ABDF-A8DA016EE645"), Description = ex.ToString()
                    },
                    ProductId  = new Guid("0D4090B2-5687-4938-ABDF-A8DA016EE645"),
                    Quantidade = 5
                };

                lista.Items.Add(v);
            }
            return(CreateResponseOnGetAll(lista, _name));
        }
Esempio n. 2
0
 public async Task <IListDto <VendaDto> > GetAllVendaAsync(VendaRequestAllDto key)
 {
     return(Context.Vendas.Include("Product").MapTo <List <VendaDto> >().ToListDto(false));
 }
Esempio n. 3
0
 public async Task <IListDto <VendaDto> > GetAllVendaAsync(VendaRequestAllDto request)
 => await _readRepository.GetAllVendaAsync(request);
Esempio n. 4
0
        public async Task <IActionResult> GetAll([FromQuery] VendaRequestAllDto requestDto)
        {
            var response = await _appService.GetAllVendaAsync(requestDto);

            return(CreateResponseOnGetAll(response, _name));
        }