/// <summary> Retrieves the related entity of type 'AuditActionEntity', using a relation of type 'n:1'</summary> /// <param name="forceFetch">if true, it will discard any changes currently in the currently loaded related entity and will refetch the entity from the persistent storage</param> /// <returns>A fetched entity of type 'AuditActionEntity' which is related to this entity.</returns> public virtual AuditActionEntity GetSingleAuditAction(bool forceFetch) { if ((!_alreadyFetchedAuditAction || forceFetch || _alwaysFetchAuditAction) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode) { bool performLazyLoading = this.CheckIfLazyLoadingShouldOccur(Relations.AuditActionEntityUsingAuditActionID); AuditActionEntity newEntity = new AuditActionEntity(); bool fetchResult = false; if (performLazyLoading) { AddToTransactionIfNecessary(newEntity); fetchResult = newEntity.FetchUsingPK(this.AuditActionID); } if (fetchResult) { newEntity = (AuditActionEntity)GetFromActiveContext(newEntity); } else { if (!_auditActionReturnsNewIfNotFound) { RemoveFromTransactionIfNecessary(newEntity); newEntity = null; } } this.AuditAction = newEntity; _alreadyFetchedAuditAction = fetchResult; } return(_auditAction); }
/// <summary> setups the sync logic for member _auditAction</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncAuditAction(IEntityCore relatedEntity) { if (_auditAction != relatedEntity) { DesetupSyncAuditAction(true, true); _auditAction = (AuditActionEntity)relatedEntity; this.PerformSetupSyncRelatedEntity(_auditAction, new PropertyChangedEventHandler(OnAuditActionPropertyChanged), "AuditAction", SD.HnD.DAL.RelationClasses.StaticRoleAuditActionRelations.AuditActionEntityUsingAuditActionIDStatic, true, ref _alreadyFetchedAuditAction, new string[] { }); } }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected RoleAuditActionEntityBase(SerializationInfo info, StreamingContext context) : base(info, context) { _auditAction = (AuditActionEntity)info.GetValue("_auditAction", typeof(AuditActionEntity)); if (_auditAction != null) { _auditAction.AfterSave += new EventHandler(OnEntityAfterSave); } _auditActionReturnsNewIfNotFound = info.GetBoolean("_auditActionReturnsNewIfNotFound"); _alwaysFetchAuditAction = info.GetBoolean("_alwaysFetchAuditAction"); _alreadyFetchedAuditAction = info.GetBoolean("_alreadyFetchedAuditAction"); _role = (RoleEntity)info.GetValue("_role", typeof(RoleEntity)); if (_role != null) { _role.AfterSave += new EventHandler(OnEntityAfterSave); } _roleReturnsNewIfNotFound = info.GetBoolean("_roleReturnsNewIfNotFound"); _alwaysFetchRole = info.GetBoolean("_alwaysFetchRole"); _alreadyFetchedRole = info.GetBoolean("_alreadyFetchedRole"); this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Removes the sync logic for member _auditAction</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 DesetupSyncAuditAction(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity(_auditAction, new PropertyChangedEventHandler(OnAuditActionPropertyChanged), "AuditAction", SD.HnD.DAL.RelationClasses.StaticRoleAuditActionRelations.AuditActionEntityUsingAuditActionIDStatic, true, signalRelatedEntity, "RoleAuditActions", resetFKFields, new int[] { (int)RoleAuditActionFieldIndex.AuditActionID }); _auditAction = null; }
/// <summary> setups the sync logic for member _auditAction</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncAuditAction(IEntityCore relatedEntity) { if(_auditAction!=relatedEntity) { DesetupSyncAuditAction(true, true); _auditAction = (AuditActionEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _auditAction, new PropertyChangedEventHandler( OnAuditActionPropertyChanged ), "AuditAction", SD.HnD.DAL.RelationClasses.StaticRoleAuditActionRelations.AuditActionEntityUsingAuditActionIDStatic, true, ref _alreadyFetchedAuditAction, new string[] { } ); } }
/// <summary> Removes the sync logic for member _auditAction</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 DesetupSyncAuditAction(bool signalRelatedEntity, bool resetFKFields) { this.PerformDesetupSyncRelatedEntity( _auditAction, new PropertyChangedEventHandler( OnAuditActionPropertyChanged ), "AuditAction", SD.HnD.DAL.RelationClasses.StaticRoleAuditActionRelations.AuditActionEntityUsingAuditActionIDStatic, true, signalRelatedEntity, "RoleAuditActions", resetFKFields, new int[] { (int)RoleAuditActionFieldIndex.AuditActionID } ); _auditAction = null; }
/// <summary> Retrieves the related entity of type 'AuditActionEntity', using a relation of type 'n:1'</summary> /// <param name="forceFetch">if true, it will discard any changes currently in the currently loaded related entity and will refetch the entity from the persistent storage</param> /// <returns>A fetched entity of type 'AuditActionEntity' which is related to this entity.</returns> public virtual AuditActionEntity GetSingleAuditAction(bool forceFetch) { if( ( !_alreadyFetchedAuditAction || forceFetch || _alwaysFetchAuditAction) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode) { bool performLazyLoading = this.CheckIfLazyLoadingShouldOccur(Relations.AuditActionEntityUsingAuditActionID); AuditActionEntity newEntity = new AuditActionEntity(); bool fetchResult = false; if(performLazyLoading) { AddToTransactionIfNecessary(newEntity); fetchResult = newEntity.FetchUsingPK(this.AuditActionID); } if(fetchResult) { newEntity = (AuditActionEntity)GetFromActiveContext(newEntity); } else { if(!_auditActionReturnsNewIfNotFound) { RemoveFromTransactionIfNecessary(newEntity); newEntity = null; } } this.AuditAction = newEntity; _alreadyFetchedAuditAction = fetchResult; } return _auditAction; }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected RoleAuditActionEntityBase(SerializationInfo info, StreamingContext context) : base(info, context) { _auditAction = (AuditActionEntity)info.GetValue("_auditAction", typeof(AuditActionEntity)); if(_auditAction!=null) { _auditAction.AfterSave+=new EventHandler(OnEntityAfterSave); } _auditActionReturnsNewIfNotFound = info.GetBoolean("_auditActionReturnsNewIfNotFound"); _alwaysFetchAuditAction = info.GetBoolean("_alwaysFetchAuditAction"); _alreadyFetchedAuditAction = info.GetBoolean("_alreadyFetchedAuditAction"); _role = (RoleEntity)info.GetValue("_role", typeof(RoleEntity)); if(_role!=null) { _role.AfterSave+=new EventHandler(OnEntityAfterSave); } _roleReturnsNewIfNotFound = info.GetBoolean("_roleReturnsNewIfNotFound"); _alwaysFetchRole = info.GetBoolean("_alwaysFetchRole"); _alreadyFetchedRole = info.GetBoolean("_alreadyFetchedRole"); this.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary>Creates a new, empty AuditActionEntity object.</summary> /// <returns>A new, empty AuditActionEntity object.</returns> public override IEntity Create() { IEntity toReturn = new AuditActionEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewAuditAction // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; }