/// <summary>Private CTor for deserialization</summary>
        /// <param name="info"></param>
        /// <param name="context"></param>
        protected OrderDetailEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            _order = (OrderEntity)info.GetValue("_order", typeof(OrderEntity));
            if (_order != null)
            {
                _order.AfterSave += new EventHandler(OnEntityAfterSave);
            }
            _orderReturnsNewIfNotFound = info.GetBoolean("_orderReturnsNewIfNotFound");
            _alwaysFetchOrder          = info.GetBoolean("_alwaysFetchOrder");
            _alreadyFetchedOrder       = info.GetBoolean("_alreadyFetchedOrder");

            _product = (ProductEntity)info.GetValue("_product", typeof(ProductEntity));
            if (_product != null)
            {
                _product.AfterSave += new EventHandler(OnEntityAfterSave);
            }
            _productReturnsNewIfNotFound = info.GetBoolean("_productReturnsNewIfNotFound");
            _alwaysFetchProduct          = info.GetBoolean("_alwaysFetchProduct");
            _alreadyFetchedProduct       = info.GetBoolean("_alreadyFetchedProduct");
            this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance());
            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
 /// <summary> Removes the sync logic for member _product</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 DesetupSyncProduct(bool signalRelatedEntity, bool resetFKFields)
 {
     this.PerformDesetupSyncRelatedEntity(_product, new PropertyChangedEventHandler(OnProductPropertyChanged), "Product", Northwind.SSDAL.RelationClasses.StaticOrderDetailRelations.ProductEntityUsingProductIdStatic, true, signalRelatedEntity, "OrderDetails", resetFKFields, new int[] { (int)OrderDetailFieldIndex.ProductId });
     _product = null;
 }