public async Task <IActionResult> Edit(long id, [Bind("CpfAcom,Nome,Rg,Nascim,Genero,Logradouro,Bairro,Complemento,Cidade,Cep,Telefone,Email,Celular,Responsavel,CpfHos")] Escorts escorts) { if (id != escorts.CpfAcom) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(escorts); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EscortsExists(escorts.CpfAcom)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(escorts)); }
public async Task <IActionResult> Create([Bind("CpfAcom,Nome,Rg,Nascim,Genero,Logradouro,Bairro,Complemento,Cidade,Cep,Telefone,Email,Celular,Responsavel,CpfHos")] Escorts escorts) { if (ModelState.IsValid) { _context.Add(escorts); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(escorts)); }