示例#1
0
        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));
        }
示例#2
0
 public Task <List <GanttTask> > GetAll() =>
 context.GanttTask.Where(m => m.UserId == requestUser.GetUserId()).OrderBy(m => m.StartDate).ToListAsync();