public async Task <IActionResult> Create([Bind("ID,FirstName,LastName,Birthday,BankNumber,Email,PhoneNumber,Address")] User user) { if (ModelState.IsValid) { _context.Add(user); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(user)); }
public async Task <IActionResult> Create([Bind("ID,Title,Description,Status,UserID")] Models.Task task) { if (ModelState.IsValid) { _context.Add(task); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["UserID"] = new SelectList(_context.Users, "ID", "ID", task.UserID); return(View(task)); }
public void Add(T entity) { _userTaskContext.Add(entity); }