示例#1
0
        public async Task <Unit> Handle(UpdateToDoList request, CancellationToken cancellationToken)
        {
            var toDoList = await _aggregateRepository.LoadAsync(request.ToDoListId);

            var @event = new ToDoListUpdatedV1(toDoList.Id, request.Label, request.Description);

            toDoList.When(@event);

            await _aggregateRepository.SaveAsync(toDoList);

            return(Unit.Value);
        }
示例#2
0
        public Task Handle(ToDoListUpdatedV1 notification, CancellationToken cancellationToken)
        {
            When(notification);

            return(Task.CompletedTask);
        }