public async Task <WorkItem> CreateWorkItem(WorkItem workItem) { var item = Map(workItem, true); context.Add(item); await context.SaveChangesAsync(); return(workItem); }
public async Task <bool> DeleteTask(UserTask task) { if (task == null) { throw new ArgumentNullException(nameof(task)); } task.deleted = true; _context.UserTasks.Update(task); await _context.SaveChangesAsync(); return(true); }
public Task AddTask(ToDoTask task) { _context.Tasks.Add(task); return(_context.SaveChangesAsync()); }