public IActionResult Get() { IEnumerable <PedidosDTO> lista = _mapper.Map <IEnumerable <PedidosDTO> >(_pedidosService.GetAll()); if (lista == null) { return(NotFound()); } foreach (var item in lista) { item.Total = CalcularTotal(item.PedidoId, item.Fecha); } return(Ok(lista)); }
public async Task <ActionResult <IEnumerable <Pedido> > > GetAll() { return(new ObjectResult(await _service.GetAll())); }