public async Task <IActionResult> Create([Bind("UserId,Email,Password")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction("Index", "Todos")); } return(View(user)); }
public async Task <IActionResult> Create([Bind("TaskID,Description,DueDate,Complete,UserID")] Todo todo) { if (ModelState.IsValid) { _context.Add(todo); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(todo)); }