Exemple #1
0
 private ConditionalWriteResult(StreamRevision nextExpectedStreamRevision, Position logPosition,
                                ConditionalWriteStatus status = ConditionalWriteStatus.Succeeded)
 {
     NextExpectedStreamRevision = nextExpectedStreamRevision;
     NextExpectedVersion        = nextExpectedStreamRevision.ToInt64();
     LogPosition = logPosition;
     Status      = status;
 }
Exemple #2
0
 public SuccessResult(StreamRevision nextExpectedStreamRevision, Position logPosition)
 {
     NextExpectedStreamRevision = nextExpectedStreamRevision;
     LogPosition         = logPosition;
     NextExpectedVersion = nextExpectedStreamRevision.ToInt64();
 }
Exemple #3
0
 public void ToInt64ExpectedResult(long expected, StreamRevision value)
 => Assert.Equal(expected, value.ToInt64());
 protected static EventData CreateLinkToEvent(string originalStreamName, StreamRevision originalRevision)
 => new EventData(Uuid.NewUuid(), SystemEventTypes.LinkTo,
                  Helper.UTF8NoBom.GetBytes($"{originalRevision.ToInt64()}@{originalStreamName}"));
 public WrongExpectedVersionException(string streamName, StreamState expectedStreamState,
                                      StreamRevision actualStreamRevision, Exception?exception = null) : base(
         $"Append failed due to WrongExpectedVersion. Stream: {streamName}, Expected state: {expectedStreamState}, Actual version: {actualStreamRevision}",
         exception)
 {
     StreamName           = streamName;
     ActualStreamRevision = actualStreamRevision;
     ActualVersion        = actualStreamRevision == StreamRevision.None ? new long?() : actualStreamRevision.ToInt64();
 }