Beispiel #1
0
        // GET: Livroes/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var livro = await _context.GetById((int)id);

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

            return(View(livro));
        }
Beispiel #2
0
        public IActionResult GetById(int id)
        {
            var livro = _livro.GetById(id);

            if (livro == null)
            {
                return(Ok("Livro não encontrado"));
            }

            return(Ok(livro));
        }