/// <summary> setups the sync logic for member _employees</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncEmployees(IEntityCore relatedEntity)
		{
			if(_employees!=relatedEntity)
			{
				DesetupSyncEmployees(true, true);
				_employees = (EmployeesEntity)relatedEntity;
				this.PerformSetupSyncRelatedEntity( _employees, new PropertyChangedEventHandler( OnEmployeesPropertyChanged ), "Employees", NW26.RelationClasses.StaticEmployeeTerritoriesRelations.EmployeesEntityUsingEmployeeIdStatic, true, new string[] {  } );
			}
		}
		protected EmployeeTerritoriesEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_employees = (EmployeesEntity)info.GetValue("_employees", typeof(EmployeesEntity));
				if(_employees!=null)
				{
					_employees.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_territories = (TerritoriesEntity)info.GetValue("_territories", typeof(TerritoriesEntity));
				if(_territories!=null)
				{
					_territories.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 _employees</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 DesetupSyncEmployees(bool signalRelatedEntity, bool resetFKFields)
		{
			this.PerformDesetupSyncRelatedEntity( _employees, new PropertyChangedEventHandler( OnEmployeesPropertyChanged ), "Employees", NW26.RelationClasses.StaticEmployeeTerritoriesRelations.EmployeesEntityUsingEmployeeIdStatic, true, signalRelatedEntity, "EmployeeTerritories", resetFKFields, new int[] { (int)EmployeeTerritoriesFieldIndex.EmployeeId } );
			_employees = null;
		}
		protected OrdersEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_orderDetails = (EntityCollection<OrderDetailsEntity>)info.GetValue("_orderDetails", typeof(EntityCollection<OrderDetailsEntity>));
				_customers = (CustomersEntity)info.GetValue("_customers", typeof(CustomersEntity));
				if(_customers!=null)
				{
					_customers.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_employees = (EmployeesEntity)info.GetValue("_employees", typeof(EmployeesEntity));
				if(_employees!=null)
				{
					_employees.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_shippers = (ShippersEntity)info.GetValue("_shippers", typeof(ShippersEntity));
				if(_shippers!=null)
				{
					_shippers.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
			}
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
			
		}