public Task OnEventAsync(Immutable <IEventSubscription> subscription, Immutable <StoredEvent> storedEvent) { if (subscription.Value != currentSubscription) { return(TaskHelper.Done); } return(DoAndUpdateStateAsync(async() => { var @event = ParseKnownEvent(storedEvent.Value); if (@event != null) { await DispatchConsumerAsync(@event); } state = state.Handled(storedEvent.Value.EventPosition); })); }
private Task HandleEventAsync(IEventSubscription subscription, StoredEvent storedEvent) { if (subscription != currentSubscription) { return(TaskHelper.Done); } return(DoAndUpdateStateAsync(async() => { var @event = ParseKnownEvent(storedEvent); if (@event != null) { await DispatchConsumerAsync(@event); } state = state.Handled(storedEvent.EventPosition); })); }