public async Task <Task> Add(Task task) { var taskTracker = await _context.Tasks.AddAsync(task); await _context.SaveChangesAsync(); var taskToReturn = await Watch(task.Id, task.CreatorId); if (taskTracker.Entity.CreatorId != taskTracker.Entity.AssigneeId) { taskToReturn = await Watch(task.Id, task.AssigneeId); } return(taskToReturn); }
public async Task <IActionResult> Create(TaskForCreationDto task) { if (!await _users.UserExist(task.CreatorId) || !await _users.UserExist(task.AssigneeId) || !await _organizations.OrganizationExist(task.OrganizationId)) { return(BadRequest("Bad request data, data don't exist.")); } var taskToCreate = new Task { Title = task.Title, Description = task.Description, CreatorId = task.CreatorId, AssigneeId = task.AssigneeId, OrganizationId = task.OrganizationId, Created = DateTime.Now, LastUpdated = DateTime.Now, }; var taskCreated = await _repo.Add(taskToCreate); var taskToReturn = _mapper.Map <TaskForListDto>(taskCreated); return(Ok(taskToReturn)); }
public Task <Task> Unwatch(Task task, User user) { throw new System.NotImplementedException(); }
public Task <Task> Unassign(Task task) { throw new System.NotImplementedException(); }
public Task <Task> Modify(Task task) { throw new System.NotImplementedException(); }
public Task <Task> Delete(Task task) { throw new System.NotImplementedException(); }