コード例 #1
0
        public async Task <ActionResult <Instituicao> > GetInstituicao(int id)
        {
            var instituicao = _context.GetEntityById(id);

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

            return(instituicao);
        }
コード例 #2
0
        // GET: Instituicoes/Details/5
        public async Task <IActionResult> Details(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var instituicao = _context.GetEntityById((int)id);

            //    .FirstOrDefaultAsync(m => m.Id == id);
            //if (instituicao == null)
            //{
            //    return NotFound();
            //}

            return(View(instituicao));
        }