public StorageBatch(TransactionalStorageLoadResponse <TState> loadresponse) { MetaData = ReadMetaData(loadresponse); ETag = loadresponse.ETag; confirmUpTo = loadresponse.CommittedSequenceId; cancelAbove = loadresponse.PendingStates.LastOrDefault()?.SequenceId ?? loadresponse.CommittedSequenceId; cancelAboveStart = cancelAbove; }
public StorageBatch(TransactionalStorageLoadResponse <TState> loadresponse) { MetaData = ReadMetaData(loadresponse); ETag = loadresponse.ETag; confirmUpTo = MetaData.StableSequenceNumber; cancelAbove = loadresponse.PendingStates?.LastOrDefault()?.SequenceId ?? MetaData.StableSequenceNumber; cancelAboveStart = cancelAbove; }
private static MetaData ReadMetaData(TransactionalStorageLoadResponse <TState> loadresponse) { if (string.IsNullOrEmpty(loadresponse.Metadata)) { // this thing is fresh... did not exist in storage yet return(new MetaData() { TimeStamp = default(DateTime), CommitRecords = new Dictionary <Guid, CommitRecord>(), }); } else { return(JsonConvert.DeserializeObject <MetaData>(loadresponse.Metadata, MetaData.SerializerSettings)); } }