예제 #1
0
    public async Task Handle(NoteEditedEvent notification, CancellationToken cancellationToken)
    {
        var note = await _readModelRepository.GetAsync <NoteDetail>(notification.AggregateId);

        note.When(notification);

        await _readModelRepository.UpdateAsync(note);

        await InsertHistoryAsync(note, notification.OccurrenceTime);
    }
예제 #2
0
    public void When(NoteEditedEvent @event)
    {
        Title                = @event.Title;
        Content              = @event.Content;
        LastModifierId       = @event.UserId;
        LastModificationTime = @event.OccurrenceTime;

        if (Status == NoteStatus.Published)
        {
            Version += 1;
        }
    }
예제 #3
0
 private void When(NoteEditedEvent @event)
 {
     _title   = @event.Title;
     _content = @event.Content;
 }