public async Task <IActionResult> AddTask(GanttTask task) { if (ModelState.IsValid) { task.UserId = requestUser.GetUserId(); tasksRepository.Add(task); await tasksRepository.SaveChanges(); return(RedirectToAction("Index")); } return(View(task)); }
public Task <List <GanttTask> > GetAll() => context.GanttTask.Where(m => m.UserId == requestUser.GetUserId()).OrderBy(m => m.StartDate).ToListAsync();