public async Task <IActionResult> Create([Bind("TaskID,ProjectID,TaskName,TaskDescription,TaskStartDate,TaskDeadline,Completed")] Tasks tasks) { if (ModelState.IsValid) { _context.Add(tasks); await _context.SaveChangesAsync(); return(RedirectToAction("Details", "Projects", new { id = tasks.ProjectID })); } return(View(tasks)); }
public async Task <IActionResult> Create(BugTrackerUser bt, [Bind("ProjectID,UserID,ProjectName,ProjectDescription,ProjectDate")] Projects projects) { if (ModelState.IsValid) { projects.UserID = _userManager.GetUserId(User); _context.Add(projects); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(projects)); }