public async Task <Unit> Handle(
            AddToDoItemListCommand command,
            CancellationToken cancellationToken)
        {
            var user = await _storage.Users
                       .Include(x => x.ToDoLists)
                       .ThenInclude(x => x.Items)
                       .FirstOrDefaultAsync(x => x.Id == command.UserId, cancellationToken);

            var list = new ToDoItemsList(command.UserId, command.Name);

            user.ToDoLists.Add(list);

            _storage.Users.Update(user);
            _storage.SaveChanges();

            return(Unit.Value);
        }
예제 #2
0
 public Task UpdateToDoList(ToDoItemsList list)
 {
     throw new NotImplementedException();
 }