public async Task <IActionResult> Criar([FromBody] Administrador administrador) { _context.Administradores.Add(administrador); await _context.SaveChangesAsync(); return(StatusCode(200, administrador)); }
public async Task <IActionResult> Create([FromBody] Pagina pagina) { _context.Add(pagina); await _context.SaveChangesAsync(); return(StatusCode(201)); }
public async Task <IActionResult> Create([Bind("Id,Nome,Conteudo,AreaRestrita,Login,Home,Ordem")] Pagina pagina) { if (ModelState.IsValid) { _context.Add(pagina); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(pagina)); }
public async Task <IActionResult> Create([Bind("Id,Nome,Telefone,Email,Senha")] Administrador administrador) { if (ModelState.IsValid) { _context.Add(administrador); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(administrador)); }