예제 #1
0
 public Task DeleteStream(
     StreamName stream,
     ExpectedStreamVersion expectedVersion,
     CancellationToken cancellationToken
     ) => TryExecute(
     () => AnyOrNot(
         expectedVersion,
         () => _client.DeleteAsync(
             stream,
             StreamState.Any,
             cancellationToken: cancellationToken
             ),
         () => _client.DeleteAsync(
             stream,
             expectedVersion.AsStreamRevision(),
             cancellationToken: cancellationToken
             )
         ),
     stream,
     () => new ErrorInfo("Unable to delete stream {Stream}", stream),
     (s, ex) => new DeleteStreamException(s, ex)
     );