Пример #1
0
 protected ProductEntity(SerializationInfo info, StreamingContext context) : base(info, context)
 {
     if (SerializationHelper.Optimization != SerializationOptimization.Fast)
     {
         _orderDetails = (EntityCollection <OrderDetailEntity>)info.GetValue("_orderDetails", typeof(EntityCollection <OrderDetailEntity>));
         _ordersCollectionViaOrderDetails = (EntityCollection <OrderEntity>)info.GetValue("_ordersCollectionViaOrderDetails", typeof(EntityCollection <OrderEntity>));
         _categories = (CategoryEntity)info.GetValue("_categories", typeof(CategoryEntity));
         if (_categories != null)
         {
             _categories.AfterSave += new EventHandler(OnEntityAfterSave);
         }
         _suppliers = (SupplierEntity)info.GetValue("_suppliers", typeof(SupplierEntity));
         if (_suppliers != null)
         {
             _suppliers.AfterSave += new EventHandler(OnEntityAfterSave);
         }
         this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
     }
     // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
     // __LLBLGENPRO_USER_CODE_REGION_END
 }
Пример #2
0
 /// <summary> Removes the sync logic for member _suppliers</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 DesetupSyncSuppliers(bool signalRelatedEntity, bool resetFKFields)
 {
     this.PerformDesetupSyncRelatedEntity(_suppliers, new PropertyChangedEventHandler(OnSuppliersPropertyChanged), "Suppliers", SD.LLBLGen.Pro.Examples.Auditing.RelationClasses.StaticProductRelations.SupplierEntityUsingSupplierIdStatic, true, signalRelatedEntity, "Products", resetFKFields, new int[] { (int)ProductFieldIndex.SupplierId });
     _suppliers = null;
 }