private void FixupKidsUserState2(KidsUserState previousValue, bool skipKeys = false) { if (IsDeserializing) { return; } if (previousValue != null && previousValue.KidsUserState1.Contains(this)) { previousValue.KidsUserState1.Remove(this); } if (KidsUserState2 != null) { if (!KidsUserState2.KidsUserState1.Contains(this)) { KidsUserState2.KidsUserState1.Add(this); } NextId = KidsUserState2.Id; } else if (!skipKeys) { NextId = null; } if (ChangeTracker.ChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("KidsUserState2") && (ChangeTracker.OriginalValues["KidsUserState2"] == KidsUserState2)) { ChangeTracker.OriginalValues.Remove("KidsUserState2"); } else { ChangeTracker.RecordOriginalValue("KidsUserState2", previousValue); } if (KidsUserState2 != null && !KidsUserState2.ChangeTracker.ChangeTrackingEnabled) { KidsUserState2.StartTracking(); } } }
private void FixupKidsUserState(KidsUserState previousValue) { if (IsDeserializing) { return; } if (previousValue != null && previousValue.KidsUsers.Contains(this)) { previousValue.KidsUsers.Remove(this); } if (KidsUserState != null) { if (!KidsUserState.KidsUsers.Contains(this)) { KidsUserState.KidsUsers.Add(this); } CurrentStatus = KidsUserState.Id; } if (ChangeTracker.ChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("KidsUserState") && (ChangeTracker.OriginalValues["KidsUserState"] == KidsUserState)) { ChangeTracker.OriginalValues.Remove("KidsUserState"); } else { ChangeTracker.RecordOriginalValue("KidsUserState", previousValue); } if (KidsUserState != null && !KidsUserState.ChangeTracker.ChangeTrackingEnabled) { KidsUserState.StartTracking(); } } }
private void FixupKidsUserState(KidsUserState previousValue, bool skipKeys = false) { if (IsDeserializing) { return; } if (previousValue != null && previousValue.Games.Contains(this)) { previousValue.Games.Remove(this); } if (KidsUserState != null) { if (!KidsUserState.Games.Contains(this)) { KidsUserState.Games.Add(this); } UserStateRequired = KidsUserState.Id; } else if (!skipKeys) { UserStateRequired = null; } if (ChangeTracker.ChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("KidsUserState") && (ChangeTracker.OriginalValues["KidsUserState"] == KidsUserState)) { ChangeTracker.OriginalValues.Remove("KidsUserState"); } else { ChangeTracker.RecordOriginalValue("KidsUserState", previousValue); } if (KidsUserState != null && !KidsUserState.ChangeTracker.ChangeTrackingEnabled) { KidsUserState.StartTracking(); } } }