private ConditionalWriteResult(StreamRevision nextExpectedStreamRevision, Position logPosition, ConditionalWriteStatus status = ConditionalWriteStatus.Succeeded) { NextExpectedStreamRevision = nextExpectedStreamRevision; NextExpectedVersion = nextExpectedStreamRevision.ToInt64(); LogPosition = logPosition; Status = status; }
public SuccessResult(StreamRevision nextExpectedStreamRevision, Position logPosition) { NextExpectedStreamRevision = nextExpectedStreamRevision; LogPosition = logPosition; NextExpectedVersion = nextExpectedStreamRevision.ToInt64(); }
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(); }