/// <summary> /// Create a new Region object. /// </summary> /// <param name="regionID">Initial value of the RegionID property.</param> /// <param name="regionDescription">Initial value of the RegionDescription property.</param> public static Region CreateRegion(global::System.Int32 regionID, global::System.String regionDescription) { Region region = new Region(); region.RegionID = regionID; region.RegionDescription = regionDescription; return region; }
private void FixupRegion(Region previousValue) { if (IsDeserializing) { return; } if (previousValue != null && previousValue.Territories.Contains(this)) { previousValue.Territories.Remove(this); } if (Region != null) { if (!Region.Territories.Contains(this)) { Region.Territories.Add(this); } RegionID = Region.RegionID; } if (ChangeTracker.ChangeTrackingEnabled) { if (ChangeTracker.OriginalValues.ContainsKey("Region") && (ChangeTracker.OriginalValues["Region"] == Region)) { ChangeTracker.OriginalValues.Remove("Region"); } else { ChangeTracker.RecordOriginalValue("Region", previousValue); } if (Region != null && !Region.ChangeTracker.ChangeTrackingEnabled) { Region.StartTracking(); } } }
/// <summary> /// Deprecated Method for adding a new object to the Regions EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToRegions(Region region) { base.AddObject("Regions", region); }