private CosmosStream(string id, string type, Version version, StreamReadStatus streamReadStatus, ReadDirection readDirection, CosmosEvent[] events) { Id = id; Type = type; Version = version; StreamReadStatus = streamReadStatus; ReadDirection = readDirection; Events = events; LastEventNumber = Events.Length; NextEventNumber = LastEventNumber + 1; }
public async Task <IExecutionResult> AppendToStreamAsync(string streamId, Version expectedVersion, params CosmosEventData[] events) => await _operationDispatcher.Dispatch(new AppendToStreamAsync(streamId, expectedVersion, events)).ConfigureAwait(false);
public CosmosStream ChangeVersion(Version version) => new CosmosStream(Id, Type, version, StreamReadStatus, ReadDirection, Events);
public static CosmosStream Create(string id, string type, Version version, StreamReadStatus streamReadStatus, ReadDirection readDirection, CosmosEvent[] events) => new CosmosStream(id, type, version, streamReadStatus, readDirection, events);