示例#1
0
        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();
                }
            }
        }
示例#2
0
 partial void ShipperChanged(Shipper previousValue);
示例#3
0
 partial void ShipperChanging(Shipper newValue);