示例#1
0
 public static void IncrementDoingVersion <PrimaryKey>(this IObserverSnapshot <PrimaryKey> state, Type grainType)
 {
     if (state.DoingVersion != state.Version)
     {
         throw new StateInsecurityException(state.StateId.ToString(), grainType, state.DoingVersion, state.Version);
     }
     state.DoingVersion += 1;
 }
示例#2
0
 public static void UnsafeUpdateVersion <PrimaryKey>(this IObserverSnapshot <PrimaryKey> snapshot, EventBase eventBase)
 {
     snapshot.DoingVersion = eventBase.Version;
     snapshot.Version      = eventBase.Version;
     if (snapshot.StartTimestamp == 0 || eventBase.Timestamp < snapshot.StartTimestamp)
     {
         snapshot.StartTimestamp = eventBase.Timestamp;
     }
 }
示例#3
0
 public static void UpdateVersion <PrimaryKey>(this IObserverSnapshot <PrimaryKey> snapshot, EventBase eventBase, Type grainType)
 {
     if (snapshot.Version + 1 != eventBase.Version)
     {
         throw new EventVersionUnorderedException(snapshot.StateId.ToString(), grainType, eventBase.Version, snapshot.Version);
     }
     snapshot.Version = eventBase.Version;
     if (snapshot.StartTimestamp == 0 || eventBase.Timestamp < snapshot.StartTimestamp)
     {
         snapshot.StartTimestamp = eventBase.Timestamp;
     }
 }