Beispiel #1
0
 /// <summary>
 /// Create a new Supplier object.
 /// </summary>
 /// <param name="supplierID">Initial value of the SupplierID property.</param>
 /// <param name="companyName">Initial value of the CompanyName property.</param>
 public static Supplier CreateSupplier(global::System.Int32 supplierID, global::System.String companyName)
 {
     Supplier supplier = new Supplier();
     supplier.SupplierID = supplierID;
     supplier.CompanyName = companyName;
     return supplier;
 }
Beispiel #2
0
        private void FixupSupplier(Supplier previousValue, bool skipKeys = false)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.Products.Contains(this))
            {
                previousValue.Products.Remove(this);
            }

            if (Supplier != null)
            {
                if (!Supplier.Products.Contains(this))
                {
                    Supplier.Products.Add(this);
                }

                SupplierID = Supplier.SupplierID;
            }
            else if (!skipKeys)
            {
                SupplierID = null;
            }

            if (ChangeTracker.ChangeTrackingEnabled)
            {
                if (ChangeTracker.OriginalValues.ContainsKey("Supplier")
                    && (ChangeTracker.OriginalValues["Supplier"] == Supplier))
                {
                    ChangeTracker.OriginalValues.Remove("Supplier");
                }
                else
                {
                    ChangeTracker.RecordOriginalValue("Supplier", previousValue);
                }
                if (Supplier != null && !Supplier.ChangeTracker.ChangeTrackingEnabled)
                {
                    Supplier.StartTracking();
                }
            }
        }
Beispiel #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Suppliers EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToSuppliers(Supplier supplier)
 {
     base.AddObject("Suppliers", supplier);
 }