public async Task <IActionResult> Create([Bind("Endereco,CPNJ,Telefone,Id,Nome,Ativo")] Instituicao instituicao) { if (ModelState.IsValid) { await _context.Add(instituicao); return(RedirectToAction(nameof(Index))); } return(View(instituicao)); }
public async Task <ActionResult <Instituicao> > PostInstituicao(Instituicao instituicao) { await _context.Add(instituicao); return(CreatedAtAction("GetInstituicao", new { id = instituicao.Id }, instituicao)); }