Пример #1
0
        public IActionResult Get()
        {
            var alugueis = _repositoryAluguel.ObterAlugueis();

            if (alugueis.Any())
            {
                return(Ok(alugueis));
            }
            return(NotFound());
        }
Пример #2
0
        public IActionResult BuscarAluguel()
        {
            try
            {
                var alugueis = _repositoryAluguel.ObterAlugueis();

                if (alugueis.Any())
                    return View(alugueis);

                return NotFound();

            }
            catch (Exception e)
            {
                throw new Exception(e.Message);
            }
        }