/// <summary> Removes the sync logic for member _products</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 DesetupSyncProducts(bool signalRelatedEntity, bool resetFKFields)
		{
			this.PerformDesetupSyncRelatedEntity( _products, new PropertyChangedEventHandler( OnProductsPropertyChanged ), "Products", NW26.RelationClasses.StaticOrderDetailsRelations.ProductsEntityUsingProductIdStatic, true, signalRelatedEntity, "OrderDetails", resetFKFields, new int[] { (int)OrderDetailsFieldIndex.ProductId } );
			_products = null;
		}
		/// <summary> setups the sync logic for member _products</summary>
		/// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
		private void SetupSyncProducts(IEntityCore relatedEntity)
		{
			if(_products!=relatedEntity)
			{
				DesetupSyncProducts(true, true);
				_products = (ProductsEntity)relatedEntity;
				this.PerformSetupSyncRelatedEntity( _products, new PropertyChangedEventHandler( OnProductsPropertyChanged ), "Products", NW26.RelationClasses.StaticOrderDetailsRelations.ProductsEntityUsingProductIdStatic, true, new string[] {  } );
			}
		}
		protected OrderDetailsEntity(SerializationInfo info, StreamingContext context) : base(info, context)
		{
			if(SerializationHelper.Optimization != SerializationOptimization.Fast) 
			{
				_orders = (OrdersEntity)info.GetValue("_orders", typeof(OrdersEntity));
				if(_orders!=null)
				{
					_orders.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				_products = (ProductsEntity)info.GetValue("_products", typeof(ProductsEntity));
				if(_products!=null)
				{
					_products.AfterSave+=new EventHandler(OnEntityAfterSave);
				}
				this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
			}
			// __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
			// __LLBLGENPRO_USER_CODE_REGION_END
			
		}