public async Task <IActionResult> Cadastrar([Bind("Id,DataLocacao,DataDevolucao")] Locacao locacao) { if (ModelState.IsValid) { _context.Add(locacao); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(locacao)); }
public async Task <IActionResult> Cadastrar([Bind("Id,Nome,Idade,Email")] Cliente cliente) { if (ModelState.IsValid) { _context.Add(cliente); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(cliente)); }
public async Task <IActionResult> Create([Bind("Id,Nome,Genero,Preco")] Filme filme) { if (ModelState.IsValid) { _context.Add(filme); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(filme)); }