/// <summary> This should only be used in the datastore dispatchers, marks that /// the object was modified by the dispatched mutation </summary> public static void MarkMutated(this IsMutable self) { if (!StateCompare.IsCurrentlyDispatching()) { throw new InvalidOperationException("Model was modified outside of the dispatchers"); } self.LastMutation = Stopwatch.GetTimestamp(); }
public override int GetHashCode() { unchecked { var hashCode = 697218593; hashCode = hashCode * -1521134295 + ID.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Description); hashCode = hashCode * -1521134295 + Group.GetHashCode(); hashCode = hashCode * -1521134295 + GroupAsInt.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(GroupDisplayName); hashCode = hashCode * -1521134295 + EqualityComparer <HashSet <int> > .Default.GetHashCode(PropertyTypes); hashCode = hashCode * -1521134295 + IsDefault.GetHashCode(); hashCode = hashCode * -1521134295 + IsMutable.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <IEnumerable <string> > .Default.GetHashCode(PropertyNames); return(hashCode); } }
/// <summary> Will be true if the object was modified when the last mutation was /// dispatched via the data store the object is managed in </summary> public static bool WasModifiedInLastDispatch(this IsMutable self) { return(StateCompare.WasModifiedInLastDispatch(self)); }
public static bool WasModifiedInLastDispatch(IsMutable mutableData) { return(instance.lastDispatchStart < mutableData.LastMutation); }