public async Task <IActionResult> Create([Bind("Id,Name")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(user)); }
public async Task <IActionResult> Create([Bind("Id,Name,EmailAddress")] EmployeeDetail employeeDetail) { if (ModelState.IsValid) { _context.Add(employeeDetail); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(employeeDetail)); }