Пример #1
0
 public static void IncrementDoingVersion <K>(this ISnapshotBase <K> snapshot, Type grainType)
 {
     if (snapshot.DoingVersion != snapshot.Version)
     {
         throw new StateInsecurityException(snapshot.StateId.ToString(), grainType, snapshot.DoingVersion, snapshot.Version);
     }
     snapshot.DoingVersion += 1;
 }
Пример #2
0
 public static void UpdateVersion <PrimaryKey>(this ISnapshotBase <PrimaryKey> snapshot, IEventBase eventBase, Type grainType)
 {
     if (snapshot.Version + 1 != eventBase.Version)
     {
         throw new EventVersionNotMatchStateException(snapshot.StateId.ToString(), grainType, eventBase.Version, snapshot.Version);
     }
     snapshot.Version = eventBase.Version;
     if (snapshot.StartTimestamp == 0 || eventBase.Timestamp < snapshot.StartTimestamp)
     {
         snapshot.StartTimestamp = eventBase.Timestamp;
     }
     if (eventBase.Timestamp < snapshot.LatestMinEventTimestamp)
     {
         snapshot.LatestMinEventTimestamp = eventBase.Timestamp;
     }
 }
Пример #3
0
 public static void DecrementDoingVersion <K>(this ISnapshotBase <K> snapshot)
 {
     snapshot.DoingVersion -= 1;
 }
Пример #4
0
 public static void DecrementDoingVersion <PrimaryKey>(this ISnapshotBase <PrimaryKey> snapshot)
 {
     snapshot.DoingVersion -= 1;
 }