예제 #1
0
        internal static StreamVersion EnsureValueRange(StreamVersion streamVersion, string argumentName)
        {
            if (streamVersion < StreamVersion.NotEmpty)
            {
                throw new ArgumentOutOfRangeException(
                          argumentName,
                          $"Stream version {streamVersion.Value} is outside of valid range [{StreamVersion.NotEmptyValue}-{StreamVersion.EndOfStreamValue}].");
            }

            return(streamVersion);
        }
예제 #2
0
 public StreamVersionConflictException(
     StreamId streamId,
     StreamVersion version,
     StreamVersion expectedVersion,
     StreamConflictReason reason,
     string message)
     : base(message)
 {
     StreamId        = streamId;
     Version         = version;
     ExpectedVersion = expectedVersion;
     Reason          = reason;
 }
 public Task SetStreamCheckpointAsync(
     string name,
     StreamId streamId,
     StreamVersion version,
     object?state = null,
     CancellationToken cancellationToken = default)
 => checkpointWriter
 .WriteAsync(
     Arguments.EnsureNotNull(name, nameof(name)),
     streamId,
     version,
     state,
     cancellationToken);
 public StreamWriteConflictException(StreamId streamId, StreamVersion version, Exception innerException)
     : base(MessageText, innerException)
 {
     StreamId = streamId;
     Version  = version;
 }
 public StreamWriteConflictException(StreamId streamId, StreamVersion version)
     : this(streamId, version, MessageText)
 {
 }
 public StreamWriteConflictException(StreamId streamId, StreamVersion version, string message)
     : base(message)
 {
     StreamId = streamId;
     Version  = version;
 }
 public Task PurgeStreamAsync(
     StreamId streamId,
     StreamVersion version,
     long count,
     CancellationToken cancellationToken = default)
 => throw new NotImplementedException();