private void FixupShipper(Shipper previousValue, bool skipKeys = false) { if (IsDeserializing) { return; } if (previousValue != null && previousValue.Orders.Contains(this)) { previousValue.Orders.Remove(this); } if (Shipper != null) { if (!Shipper.Orders.Contains(this)) { Shipper.Orders.Add(this); } ShipVia = Shipper.ShipperID; } else if (!skipKeys) { ShipVia = null; } if (ChangeTracker.IsChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("Shipper") && ReferenceEquals(ChangeTracker.OriginalValues["Shipper"], Shipper)) { //ChangeTracker.OriginalValues.Remove("Shipper"); } else { //RecordOriginalValue("Shipper", previousValue); } if (Shipper != null && !Shipper.ChangeTracker.IsChangeTrackingEnabled) { Shipper.StartTracking(); } } }
partial void ShipperChanged(Shipper previousValue);
partial void ShipperChanging(Shipper newValue);