Пример #1
0
        public async Task HandleAsync(TodoItemMarkedAsUnComplete @event)
        {
            var todoItem = await this._unitOfWork.Repository <TodoItem>().GetByIdAsync(@event.SourceId);

            todoItem.IsComplete = false;
            todoItem.Version    = @event.Version;
            this._unitOfWork.Repository <TodoItem>().Update(todoItem);
            await this._unitOfWork.SaveChangesAsync();
        }
Пример #2
0
        public void MarkTodoItemAsUnComplete()
        {
            if (!this.IsComplete)
            {
                throw new DomainValidationException("Todo item is already marked as uncomplete");
            }
            var @event = new TodoItemMarkedAsUnComplete();

            ApplyEvent(@event);
        }
 public async Task HandleAsync(TodoItemMarkedAsUnComplete @event)
 {
     await Task.Delay(500);
 }
Пример #4
0
 public void When(TodoItemMarkedAsUnComplete @event)
 {
     this.IsComplete = false;
 }