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)); }
public async Task <IListDto <VendaDto> > GetAllVendaAsync(VendaRequestAllDto key) { return(Context.Vendas.Include("Product").MapTo <List <VendaDto> >().ToListDto(false)); }
public async Task <IListDto <VendaDto> > GetAllVendaAsync(VendaRequestAllDto request) => await _readRepository.GetAllVendaAsync(request);
public async Task <IActionResult> GetAll([FromQuery] VendaRequestAllDto requestDto) { var response = await _appService.GetAllVendaAsync(requestDto); return(CreateResponseOnGetAll(response, _name)); }