/// <summary> setups the sync logic for member _unitMeasure</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncUnitMeasure(IEntityCore relatedEntity) { if (_unitMeasure != relatedEntity) { DesetupSyncUnitMeasure(true, true); _unitMeasure = (UnitMeasureEntity)relatedEntity; this.PerformSetupSyncRelatedEntity(_unitMeasure, new PropertyChangedEventHandler(OnUnitMeasurePropertyChanged), "UnitMeasure", AdventureWorks.Dal.Adapter.v51.RelationClasses.StaticProductVendorRelations.UnitMeasureEntityUsingUnitMeasureCodeStatic, true, new string[] { }); } }
protected ProductVendorEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if (SerializationHelper.Optimization != SerializationOptimization.Fast) { _product = (ProductEntity)info.GetValue("_product", typeof(ProductEntity)); if (_product != null) { _product.AfterSave += new EventHandler(OnEntityAfterSave); } _unitMeasure = (UnitMeasureEntity)info.GetValue("_unitMeasure", typeof(UnitMeasureEntity)); if (_unitMeasure != null) { _unitMeasure.AfterSave += new EventHandler(OnEntityAfterSave); } _vendor = (VendorEntity)info.GetValue("_vendor", typeof(VendorEntity)); if (_vendor != null) { _vendor.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 _unitMeasure</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 DesetupSyncUnitMeasure(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity(_unitMeasure, new PropertyChangedEventHandler(OnUnitMeasurePropertyChanged), "UnitMeasure", AdventureWorks.Dal.Adapter.v51.RelationClasses.StaticProductVendorRelations.UnitMeasureEntityUsingUnitMeasureCodeStatic, true, signalRelatedEntity, "ProductVendors", resetFKFields, new int[] { (int)ProductVendorFieldIndex.UnitMeasureCode }); _unitMeasure = null; }