//------------------------------------------------------------------------------ // // This code was generated from a template. // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Collections.Specialized; namespace WNS.Entities { public partial class KeywordList { #region Primitive Properties public virtual int Id { get; set; } public virtual string Keyword { get; set; } public virtual int WebMapServiceId { get { return _webMapServiceId; } set { if (_webMapServiceId != value) { if (WebMapService != null && WebMapService.Id != value) { WebMapService = null; } _webMapServiceId = value; } } } private int _webMapServiceId; #endregion #region Navigation Properties public virtual WebMapService WebMapService { get { return _webMapService; } set { if (!ReferenceEquals(_webMapService, value)) { var previousValue = _webMapService; _webMapService = value; FixupWebMapService(previousValue); } } } private WebMapService _webMapService; #endregion #region Association Fixup private void FixupWebMapService(WebMapService previousValue) { if (previousValue != null && previousValue.KeywordList.Contains(this)) { previousValue.KeywordList.Remove(this); } if (WebMapService != null) { if (!WebMapService.KeywordList.Contains(this)) { WebMapService.KeywordList.Add(this); } if (WebMapServiceId != WebMapService.Id) { WebMapServiceId = WebMapService.Id; } } } #endregion } }