/// <summary> Removes the sync logic for member _category</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 DesetupSyncCategory(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity( _category, new PropertyChangedEventHandler( OnCategoryPropertyChanged ), "Category", NW26.RelationClasses.StaticProductRelations.CategoryEntityUsingCategoryIdStatic, true, signalRelatedEntity, "Products", resetFKFields, new int[] { (int)ProductFieldIndex.CategoryId } ); _category = null; }
/// <summary> setups the sync logic for member _category</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncCategory(IEntityCore relatedEntity) { if(_category!=relatedEntity) { DesetupSyncCategory(true, true); _category = (CategoryEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _category, new PropertyChangedEventHandler( OnCategoryPropertyChanged ), "Category", NW26.RelationClasses.StaticProductRelations.CategoryEntityUsingCategoryIdStatic, true, new string[] { } ); } }
protected ProductEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if(SerializationHelper.Optimization != SerializationOptimization.Fast) { _orderDetails = (EntityCollection<OrderDetailEntity>)info.GetValue("_orderDetails", typeof(EntityCollection<OrderDetailEntity>)); _orderCollectionViaOrderDetail = (EntityCollection<OrderEntity>)info.GetValue("_orderCollectionViaOrderDetail", typeof(EntityCollection<OrderEntity>)); _category = (CategoryEntity)info.GetValue("_category", typeof(CategoryEntity)); if(_category!=null) { _category.AfterSave+=new EventHandler(OnEntityAfterSave); } _supplier = (SupplierEntity)info.GetValue("_supplier", typeof(SupplierEntity)); if(_supplier!=null) { _supplier.AfterSave+=new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }