Exemple #1
0
 /// <summary>
 /// Create a new Shipper object.
 /// </summary>
 /// <param name="shipperID">Initial value of the ShipperID property.</param>
 /// <param name="companyName">Initial value of the CompanyName property.</param>
 public static Shipper CreateShipper(global::System.Int32 shipperID, global::System.String companyName)
 {
     Shipper shipper = new Shipper();
     shipper.ShipperID = shipperID;
     shipper.CompanyName = companyName;
     return shipper;
 }
Exemple #2
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.ChangeTrackingEnabled)
            {
                if (ChangeTracker.OriginalValues.ContainsKey("Shipper")
                    && (ChangeTracker.OriginalValues["Shipper"] == Shipper))
                {
                    ChangeTracker.OriginalValues.Remove("Shipper");
                }
                else
                {
                    ChangeTracker.RecordOriginalValue("Shipper", previousValue);
                }
                if (Shipper != null && !Shipper.ChangeTracker.ChangeTrackingEnabled)
                {
                    Shipper.StartTracking();
                }
            }
        }
Exemple #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Shippers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToShippers(Shipper shipper)
 {
     base.AddObject("Shippers", shipper);
 }