public async Task <WorkItem> CreateWorkItem(WorkItem workItem)
        {
            var item = Map(workItem, true);

            context.Add(item);

            await context.SaveChangesAsync();

            return(workItem);
        }
예제 #2
0
        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);
        }
예제 #3
0
        public Task AddTask(ToDoTask task)
        {
            _context.Tasks.Add(task);

            return(_context.SaveChangesAsync());
        }