public IActionResult GetAlugueisAtivos()
        {
            try
            {
                IEnumerable <AluguelModel> currentModel = AluguelModel.ToListModel(_aluguelBusiness.Get(p => p.Devolveu == null));

                if (currentModel == null)
                {
                    return(NotFound());
                }

                return(Ok(ListBodyModel <AluguelModel> .ToBodyList(currentModel)));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }
Ejemplo n.º 2
0
        public IActionResult Get(int id)
        {
            try
            {
                AluguelModel currentModel = AluguelModel.ToModel(_aluguelBusiness.Get(id));

                if (currentModel == null)
                {
                    return(NotFound());
                }

                return(Ok(currentModel.ToBody()));
            }
            catch (Exception ex)
            {
                return(StatusCode(500, ex.Message));
            }
        }