public async Task <IActionResult> Create([Bind("EmpresaID,Nome")] Empresa empresa) { if (ModelState.IsValid) { _context.Add(empresa); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(empresa)); }
public async Task <IActionResult> Create([Bind("Id,Title,ReleaseDate,Genre,Price,Rating")] Movie movie) { if (ModelState.IsValid) { _context.Add(movie); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(movie)); }
public async Task <IActionResult> Create([Bind("FunçãoID,Cargo,EmpresaID")] Função função) { if (ModelState.IsValid) { _context.Add(função); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["EmpresaID"] = new SelectList(_context.Set <Empresa>(), "EmpresaID", "EmpresaID", função.EmpresaID); return(View(função)); }