/// <summary> Removes the sync logic for member _individual</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 DesetupSyncIndividual(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity( _individual, new PropertyChangedEventHandler( OnIndividualPropertyChanged ), "Individual", AdventureWorks.Dal.Adapter.v41.RelationClasses.StaticCustomerRelations.IndividualEntityUsingCustomerIdStatic, false, signalRelatedEntity, "Customer", false, new int[] { (int)CustomerFieldIndex.CustomerId } ); _individual = null; }
/// <summary> setups the sync logic for member _individual</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncIndividual(IEntityCore relatedEntity) { if(_individual!=relatedEntity) { DesetupSyncIndividual(true, true); _individual = (IndividualEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _individual, new PropertyChangedEventHandler( OnIndividualPropertyChanged ), "Individual", AdventureWorks.Dal.Adapter.v41.RelationClasses.StaticCustomerRelations.IndividualEntityUsingCustomerIdStatic, false, new string[] { } ); } }
protected CustomerEntity(SerializationInfo info, StreamingContext context) : base(info, context) { if(SerializationHelper.Optimization != SerializationOptimization.Fast) { _customerAddresses = (EntityCollection<CustomerAddressEntity>)info.GetValue("_customerAddresses", typeof(EntityCollection<CustomerAddressEntity>)); _salesOrderHeaders = (EntityCollection<SalesOrderHeaderEntity>)info.GetValue("_salesOrderHeaders", typeof(EntityCollection<SalesOrderHeaderEntity>)); _salesTerritory = (SalesTerritoryEntity)info.GetValue("_salesTerritory", typeof(SalesTerritoryEntity)); if(_salesTerritory!=null) { _salesTerritory.AfterSave+=new EventHandler(OnEntityAfterSave); } _individual = (IndividualEntity)info.GetValue("_individual", typeof(IndividualEntity)); if(_individual!=null) { _individual.AfterSave+=new EventHandler(OnEntityAfterSave); } _store = (StoreEntity)info.GetValue("_store", typeof(StoreEntity)); if(_store!=null) { _store.AfterSave+=new EventHandler(OnEntityAfterSave); } this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance()); } // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }