Esempio n. 1
0
    public async Task Handle(NotePublishedEvent notification, CancellationToken cancellationToken)
    {
        var note = await _readModelRepository.GetAsync <NoteDetail>(notification.AggregateId);

        note.When(notification);

        await _readModelRepository.UpdateAsync(note);

        await InsertHistoryAsync(note, notification.OccurrenceTime);
    }
Esempio n. 2
0
 public void When(NotePublishedEvent @event)
 {
     Status   = NoteStatus.Published;
     Version += 1;
 }
Esempio n. 3
0
 private void When(NotePublishedEvent @event)
 {
     _status = NoteStatus.Published;
 }