Example #1
0
 public StorageBatch(TransactionalStorageLoadResponse <TState> loadresponse)
 {
     MetaData         = ReadMetaData(loadresponse);
     ETag             = loadresponse.ETag;
     confirmUpTo      = loadresponse.CommittedSequenceId;
     cancelAbove      = loadresponse.PendingStates.LastOrDefault()?.SequenceId ?? loadresponse.CommittedSequenceId;
     cancelAboveStart = cancelAbove;
 }
Example #2
0
 public StorageBatch(TransactionalStorageLoadResponse <TState> loadresponse)
 {
     MetaData         = ReadMetaData(loadresponse);
     ETag             = loadresponse.ETag;
     confirmUpTo      = MetaData.StableSequenceNumber;
     cancelAbove      = loadresponse.PendingStates?.LastOrDefault()?.SequenceId ?? MetaData.StableSequenceNumber;
     cancelAboveStart = cancelAbove;
 }
Example #3
0
 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));
     }
 }