예제 #1
0
 public void OnNoteCreated(NoteCreatedEvent @event)
 {
     CreatedDate = @event.CreatedTime;
     Title       = @event.Title;
     Description = @event.Desc;
     Category    = @event.Cat;
 }
예제 #2
0
        public Task <bool> Handle(CreateNoteCommand request, CancellationToken cancellationToken)
        {
            var noteCreatedEvent = new NoteCreatedEvent(
                request.Header,
                request.Content);

            bus.Publish(noteCreatedEvent);

            return(Task.FromResult(true));
        }
예제 #3
0
 private void When(NoteCreatedEvent @event)
 {
     _spaceId     = @event.SpaceId;
     _creatorId   = @event.CreatorId;
     _title       = @event.Title;
     _content     = @event.Content;
     _status      = @event.Status;
     _visibility  = @event.Visibility;
     _cloneFormId = @event.CloneFormId;
     _tags        = new List <string>();
 }
예제 #4
0
 public void When(NoteCreatedEvent @event)
 {
     Id           = @event.AggregateId;
     Content      = @event.Content;
     Status       = @event.Status;
     Title        = @event.Title;
     Visibility   = @event.Visibility;
     CreatorId    = @event.CreatorId;
     CreationTime = @event.OccurrenceTime;
     SpaceId      = @event.SpaceId;
     CloneFormId  = @event.CloneFormId;
     Version      = Status == NoteStatus.Draft ? 0 : 1;
 }