public async Task <IActionResult> Create([Bind("Id,Nome,Email,DataDeNascimento")] Pessoa pessoa) { if (ModelState.IsValid) { _context.Add(pessoa); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(pessoa)); }
public async Task <IActionResult> Create([Bind("Id,EmailText,PessoaId")] Email email) { if (ModelState.IsValid) { _context.Add(email); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["PessoaId"] = new SelectList(_context.Pessoa, "Id", "Nome", email.PessoaId); return(View(email)); }