/// <summary> setups the sync logic for member _customer</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncCustomer(IEntityCore relatedEntity)
 {
     if(_customer!=relatedEntity)
     {
         DesetupSyncCustomer(true, true);
         _customer = (CustomerEntity)relatedEntity;
         this.PerformSetupSyncRelatedEntity( _customer, new PropertyChangedEventHandler( OnCustomerPropertyChanged ), "Customer", Northwind.Data.RelationClasses.StaticCustomerCustomerDemoRelations.CustomerEntityUsingCustomerIdStatic, true, new string[] {  } );
     }
 }
 /// <summary> Removes the sync logic for member _customer</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 DesetupSyncCustomer(bool signalRelatedEntity, bool resetFKFields)
 {
     this.PerformDesetupSyncRelatedEntity( _customer, new PropertyChangedEventHandler( OnCustomerPropertyChanged ), "Customer", Northwind.Data.RelationClasses.StaticCustomerCustomerDemoRelations.CustomerEntityUsingCustomerIdStatic, true, signalRelatedEntity, "CustomerCustomerDemos", resetFKFields, new int[] { (int)CustomerCustomerDemoFieldIndex.CustomerId } );
     _customer = null;
 }
 protected OrderEntity(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     if(SerializationHelper.Optimization != SerializationOptimization.Fast)
     {
         _orderDetails = (EntityCollection<OrderDetailEntity>)info.GetValue("_orderDetails", typeof(EntityCollection<OrderDetailEntity>));
         _customer = (CustomerEntity)info.GetValue("_customer", typeof(CustomerEntity));
         if(_customer!=null)
         {
             _customer.AfterSave+=new EventHandler(OnEntityAfterSave);
         }
         _employee = (EmployeeEntity)info.GetValue("_employee", typeof(EmployeeEntity));
         if(_employee!=null)
         {
             _employee.AfterSave+=new EventHandler(OnEntityAfterSave);
         }
         _shipper = (ShipperEntity)info.GetValue("_shipper", typeof(ShipperEntity));
         if(_shipper!=null)
         {
             _shipper.AfterSave+=new EventHandler(OnEntityAfterSave);
         }
         this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
     }
     // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
     // __LLBLGENPRO_USER_CODE_REGION_END
 }
 protected CustomerCustomerDemoEntity(SerializationInfo info, StreamingContext context)
     : base(info, context)
 {
     if(SerializationHelper.Optimization != SerializationOptimization.Fast)
     {
         _customer = (CustomerEntity)info.GetValue("_customer", typeof(CustomerEntity));
         if(_customer!=null)
         {
             _customer.AfterSave+=new EventHandler(OnEntityAfterSave);
         }
         _customerDemographic = (CustomerDemographicEntity)info.GetValue("_customerDemographic", typeof(CustomerDemographicEntity));
         if(_customerDemographic!=null)
         {
             _customerDemographic.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 _customer</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 DesetupSyncCustomer(bool signalRelatedEntity, bool resetFKFields)
 {
     this.PerformDesetupSyncRelatedEntity(_customer, new PropertyChangedEventHandler(OnCustomerPropertyChanged), "Customer", Northwind.Data.RelationClasses.StaticOrderRelations.CustomerEntityUsingCustomerIdStatic, true, signalRelatedEntity, "Orders", resetFKFields, new int[] { (int)OrderFieldIndex.CustomerId });
     _customer = null;
 }