/// <summary> setups the sync logic for member _scrapReason</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncScrapReason(IEntityCore relatedEntity) { if (_scrapReason != relatedEntity) { DesetupSyncScrapReason(true, true); _scrapReason = (ScrapReasonEntity)relatedEntity; this.PerformSetupSyncRelatedEntity(_scrapReason, new PropertyChangedEventHandler(OnScrapReasonPropertyChanged), "ScrapReason", AdventureWorks.Dal.Adapter.v51.RelationClasses.StaticWorkOrderRelations.ScrapReasonEntityUsingScrapReasonIdStatic, true, new string[] { }); } }
protected WorkOrderEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _workOrderRoutings = (EntityCollection <WorkOrderRoutingEntity>)info.GetValue("_workOrderRoutings", typeof(EntityCollection <WorkOrderRoutingEntity>)); _product = (ProductEntity)info.GetValue("_product", typeof(ProductEntity)); if (_product != null) { _product.AfterSave += new EventHandler(OnEntityAfterSave); } _scrapReason = (ScrapReasonEntity)info.GetValue("_scrapReason", typeof(ScrapReasonEntity)); if (_scrapReason != null) { _scrapReason.AfterSave += new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Removes the sync logic for member _scrapReason</summary> /// <param name="signalRelatedEntity">If set to true, it will call the related entity's UnsetRelatedEntity method</param> /// <param name="resetFKFields">if set to true it will also reset the FK fields pointing to the related entity</param> private void DesetupSyncScrapReason(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity(_scrapReason, new PropertyChangedEventHandler(OnScrapReasonPropertyChanged), "ScrapReason", AdventureWorks.Dal.Adapter.v51.RelationClasses.StaticWorkOrderRelations.ScrapReasonEntityUsingScrapReasonIdStatic, true, signalRelatedEntity, "WorkOrders", resetFKFields, new int[] { (int)WorkOrderFieldIndex.ScrapReasonId }); _scrapReason = null; }