Example #1
0
        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));
        }
Example #2
0
        public async Task <ActionResult <Instituicao> > PostInstituicao(Instituicao instituicao)
        {
            await _context.Add(instituicao);

            return(CreatedAtAction("GetInstituicao", new { id = instituicao.Id }, instituicao));
        }