private void FixupMedia(Media previousValue) { if (IsDeserializing) { return; } if (ChangeTracker.ChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("Media") && (ChangeTracker.OriginalValues["Media"] == Media)) { ChangeTracker.OriginalValues.Remove("Media"); } else { ChangeTracker.RecordOriginalValue("Media", previousValue); } if (Media != null && !Media.ChangeTracker.ChangeTrackingEnabled) { Media.StartTracking(); } FixupMediaKeys(); } }
private void FixupMedia(Media previousValue) { if (IsDeserializing) { return; } if (previousValue != null && ReferenceEquals(previousValue.Stocks, this)) { previousValue.Stocks = null; } if (Media != null) { Media.Stocks = this; } if (ChangeTracker.ChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("Media") && (ChangeTracker.OriginalValues["Media"] == Media)) { ChangeTracker.OriginalValues.Remove("Media"); } else { ChangeTracker.RecordOriginalValue("Media", previousValue); } if (Media != null && !Media.ChangeTracker.ChangeTrackingEnabled) { Media.StartTracking(); } } }