Beispiel #1
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ProductClasses EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToProductClasses(ProductClass productClass)
 {
     base.AddObject("ProductClasses", productClass);
 }
Beispiel #2
0
 /// <summary>
 /// Create a new ProductClass object.
 /// </summary>
 /// <param name="classId">Initial value of the ClassId property.</param>
 public static ProductClass CreateProductClass(global::System.Int16 classId)
 {
     ProductClass productClass = new ProductClass();
     productClass.ClassId = classId;
     return productClass;
 }
Beispiel #3
0
        private void FixupProductClass(ProductClass previousValue, bool skipKeys = false)
        {
            if (IsDeserializing)
            {
                return;
            }

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

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

                ClassId = ProductClass.ClassId;
            }
            else if (!skipKeys)
            {
                ClassId = null;
            }

            if (ChangeTracker.ChangeTrackingEnabled)
            {
                if (ChangeTracker.OriginalValues.ContainsKey("ProductClass")
                    && (ChangeTracker.OriginalValues["ProductClass"] == ProductClass))
                {
                    ChangeTracker.OriginalValues.Remove("ProductClass");
                }
                else
                {
                    ChangeTracker.RecordOriginalValue("ProductClass", previousValue);
                }
                if (ProductClass != null && !ProductClass.ChangeTracker.ChangeTrackingEnabled)
                {
                    ProductClass.StartTracking();
                }
            }
        }