/// <summary> setups the sync logic for member _afmarketingMaterialGroup</summary>
 /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param>
 private void SetupSyncAfmarketingMaterialGroup(IEntity2 relatedEntity)
 {
     if (_afmarketingMaterialGroup != relatedEntity)
     {
         DesetupSyncAfmarketingMaterialGroup(true, true);
         _afmarketingMaterialGroup = (AfmarketingMaterialGroupEntity)relatedEntity;
         base.PerformSetupSyncRelatedEntity(_afmarketingMaterialGroup, new PropertyChangedEventHandler(OnAfmarketingMaterialGroupPropertyChanged), "AfmarketingMaterialGroup", AfmarketingMaterialTypeEntity.Relations.AfmarketingMaterialGroupEntityUsingGroupId, true, new string[] {  });
     }
 }
        /// <summary> Initializes the class members</summary>
        protected virtual void InitClassMembers()
        {
            _afmarketingMaterial = null;
            _eventsCollectionViaAfmarketingMaterial = null;
            _afmarketingMaterialGroup = null;

            PerformDependencyInjection();

            // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers
            // __LLBLGENPRO_USER_CODE_REGION_END
            OnInitClassMembersComplete();
        }
        protected AfmarketingMaterialTypeEntity(SerializationInfo info, StreamingContext context) : base(info, context)
        {
            if (SerializationHelper.Optimization != SerializationOptimization.Fast)
            {
                _afmarketingMaterial = (EntityCollection <AfmarketingMaterialEntity>)info.GetValue("_afmarketingMaterial", typeof(EntityCollection <AfmarketingMaterialEntity>));
                _eventsCollectionViaAfmarketingMaterial = (EntityCollection <EventsEntity>)info.GetValue("_eventsCollectionViaAfmarketingMaterial", typeof(EntityCollection <EventsEntity>));
                _afmarketingMaterialGroup = (AfmarketingMaterialGroupEntity)info.GetValue("_afmarketingMaterialGroup", typeof(AfmarketingMaterialGroupEntity));
                if (_afmarketingMaterialGroup != null)
                {
                    _afmarketingMaterialGroup.AfterSave += new EventHandler(OnEntityAfterSave);
                }

                base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance());
            }

            // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor
            // __LLBLGENPRO_USER_CODE_REGION_END
        }
 /// <summary>Gets the relation objects which represent the relation the fieldName specified is mapped on. </summary>
 /// <param name="fieldName">Name of the field mapped onto the relation of which the relation objects have to be obtained.</param>
 /// <returns>RelationCollection with relation object(s) which represent the relation the field is maped on</returns>
 public override RelationCollection GetRelationsForFieldOfType(string fieldName)
 {
     return(AfmarketingMaterialGroupEntity.GetRelationsForField(fieldName));
 }
 /// <summary> Removes the sync logic for member _afmarketingMaterialGroup</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 DesetupSyncAfmarketingMaterialGroup(bool signalRelatedEntity, bool resetFKFields)
 {
     base.PerformDesetupSyncRelatedEntity(_afmarketingMaterialGroup, new PropertyChangedEventHandler(OnAfmarketingMaterialGroupPropertyChanged), "AfmarketingMaterialGroup", AfmarketingMaterialTypeEntity.Relations.AfmarketingMaterialGroupEntityUsingGroupId, true, signalRelatedEntity, "AfmarketingMaterialType", resetFKFields, new int[] { (int)AfmarketingMaterialTypeFieldIndex.GroupId });
     _afmarketingMaterialGroup = null;
 }