示例#1
0
 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;
 }
示例#2
0
 public async Task <IExecutionResult> AppendToStreamAsync(string streamId, Version expectedVersion, params CosmosEventData[] events) =>
 await _operationDispatcher.Dispatch(new AppendToStreamAsync(streamId, expectedVersion, events)).ConfigureAwait(false);
示例#3
0
 public CosmosStream ChangeVersion(Version version) =>
 new CosmosStream(Id, Type, version, StreamReadStatus, ReadDirection, Events);
示例#4
0
 public static CosmosStream Create(string id, string type, Version version, StreamReadStatus streamReadStatus,
                                   ReadDirection readDirection, CosmosEvent[] events) =>
 new CosmosStream(id, type, version, streamReadStatus, readDirection, events);