/// <inheritdoc /> public async Task Commit(CommittedEvents events, ConsentId consent, ScopeId scope) { foreach (var @event in events) { var sequenceNumber = await _policies.WriteEvent.ExecuteAsync( _ => _receivedEventsWriter.Write(@event, consent, scope, CancellationToken.None), CancellationToken.None).ConfigureAwait(false); await _eventStoreClient.CommitExternal(new CommitExternalEventsRequest { ScopeId = scope.ToProtobuf(), Event = new CommittedEvent( sequenceNumber, @event.Occurred, @event.EventSource, @event.ExecutionContext, @event.Type, @event.Public, @event.Content).ToProtobuf() }, CancellationToken.None).ConfigureAwait(false); } }