예제 #1
0
 public async Task Handle(TaskLinkCreatedEvent notification, CancellationToken cancellationToken)
 {
     using (var connection = this._dbConnectionFactory.OpenConnection())
     {
         var repository = new TaskLinksRepository();
         await repository.CreateNewLinkbetweenTasksAsync(connection, notification.AggregateId,
                                                         notification.LinkToTaskId);
     }
 }
예제 #2
0
        public void LinkToTask(Guid linkedTaskId)
        {
            if (this.TaskLinks.Contains(linkedTaskId))
            {
                throw new DuplicateTaskLinkException(linkedTaskId);
            }

            var attachedEvent = new TaskLinkCreatedEvent(this.AggregateId, linkedTaskId);

            this.RaiseEvent(attachedEvent);
        }
예제 #3
0
 private void Apply(TaskLinkCreatedEvent obj)
 {
     this.TaskLinks.Add(obj.LinkToTaskId);
 }