コード例 #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);
            }
        }