コード例 #1
0
        public IActionResult Get(int clienteId)
        {
            var lista = _mapper.Map <IEnumerable <PedidosDTO> >(_pedidosService.GetByCliente(clienteId));

            if (lista == null)
            {
                return(NotFound());
            }
            foreach (var item in lista)
            {
                item.Total = CalcularTotal(item.PedidoId, item.Fecha);
            }
            return(Ok(lista));
        }