/// <summary> setups the sync logic for member _categories</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncCategories(IEntityCore relatedEntity) { if (_categories != relatedEntity) { DesetupSyncCategories(true, true); _categories = (CategoriesEntity)relatedEntity; this.PerformSetupSyncRelatedEntity(_categories, new PropertyChangedEventHandler(OnCategoriesPropertyChanged), "Categories", SD.LLBLGen.Pro.Examples.WCF.RelationClasses.StaticProductsRelations.CategoriesEntityUsingCategoryIdStatic, true, new string[] { }); } }
protected ProductsEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _orderDetails = (EntityCollection <OrderDetailsEntity>)info.GetValue("_orderDetails", typeof(EntityCollection <OrderDetailsEntity>)); _ordersCollectionViaOrderDetails = (EntityCollection <OrdersEntity>)info.GetValue("_ordersCollectionViaOrderDetails", typeof(EntityCollection <OrdersEntity>)); _categories = (CategoriesEntity)info.GetValue("_categories", typeof(CategoriesEntity)); if (_categories != null) { _categories.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 _categories</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 DesetupSyncCategories(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity(_categories, new PropertyChangedEventHandler(OnCategoriesPropertyChanged), "Categories", SD.LLBLGen.Pro.Examples.WCF.RelationClasses.StaticProductsRelations.CategoriesEntityUsingCategoryIdStatic, true, signalRelatedEntity, "Products", resetFKFields, new int[] { (int)ProductsFieldIndex.CategoryId }); _categories = null; }