public virtual void Construct(GOLoginHistoryDataObject gOLoginHistory, bool includeDirtyObjectsOnly) { if (gOLoginHistory == null) { return; } this.PrimaryKey = gOLoginHistory.PrimaryKey; if (gOLoginHistory.ObjectsDataSet == null) { var dataset = ApplicationSettings.Container.Resolve <IObjectsDataSet>(); dataset.AddObject(gOLoginHistory); } if (gOLoginHistory.ObjectsDataSet == null) { _logEngine.LogError("Unable to set a dataset to the Entity GOLoginHistory", "Unable to set a dataset to the entity. Container may not be initialized", "GOLoginHistoryDataObject", null); throw new PulpException("Unexpected Error : Unable to set a dataset to the entity : GOLoginHistory"); } if (gOLoginHistory.InternalObjectId == null) { _logEngine.LogError("Unable to construct an object without InternalObjectId in GOLoginHistoryDataObject", "The Object you are trying to construct doesn't have an InternalObjectId", "GOLoginHistoryDataObject", null); throw new PulpException("Unexpected Error : Unable to construct an object without InternalObjectId in GOLoginHistoryDataObject"); } this.InternalObjectId = (int)gOLoginHistory.InternalObjectId; this.ObjectsDataSet = includeDirtyObjectsOnly ? gOLoginHistory.ObjectsDataSet.CloneDirtyObjects() : gOLoginHistory.ObjectsDataSet; }
protected void SetProperties(GOLoginHistoryDataObject x) { x.SetIdValue(Id, false, false); x.SetInfoValue(Info, false, false); x.SetUserValue(User, false, false); x.SetTimestampValue(Timestamp, false, false); x.SetResultValue(Result, false, false); }
/// /// PK-Side one-to-one relations /// /// /// All FK-Side Relations /// /// /// PK-Side one-to-many relations /// /// /// Bridge to DataObject /// public virtual IDataObject ToDataObject(IObjectsDataSet dataset) { var session = NHibernateSessionController.GetCurrentSession(); session.Evict(this); var x = new GOLoginHistoryDataObject(); SetProperties(x); x.IsDirty = x.IsNew = x.IsMarkedForDeletion = false; x.ObjectsDataSet = dataset; x.ObjectsDataSet.AddObjectIfDoesNotExist(x); // Deep-map prefetch relations if (PrefetchAssociations.HasPrefetchForEntity("GOLoginHistory", ApplicationSettings.Resolve <IDataProviderTransaction>()?.Parameters)) { SetRelations(x); } return(x); }
/// <summary> /// Copy Constructor /// </summary> public GOLoginHistoryDataObject(GOLoginHistoryDataObject template, bool deepCopy) { this.SetTimestampValue(template.Timestamp, false, false); this._timestamp_WithTimezoneOffset = template._timestamp_WithTimezoneOffset; this.SetIdValue(template.Id, false, false); this.SetInfoValue(template.Info, false, false); this.SetResultValue(template.Result, false, false); this.SetUserValue(template.User, false, false); this.SetIsNewValue(template.IsNew, false, false); if (deepCopy) { this.ObjectsDataSet = template.ObjectsDataSet.Clone(); // Remove the template object from the dataset this.ObjectsDataSet.RemoveObject(template); // And Replace by the one we're currently constructing this.ObjectsDataSet.AddObject(this); } this.SetIsDirtyValue(template.IsDirty, false, false); this.SetIsMarkedForDeletionValue(template.IsMarkedForDeletion, false, false); }
protected void SetRelations(GOLoginHistoryDataObject x) { var prefetches = PrefetchAssociations.Get("GOLoginHistory", ApplicationSettings.Resolve <IDataProviderTransaction>()?.Parameters); }
public GOLoginHistoryContainer(GOLoginHistoryDataObject gOLoginHistory, bool includeDirtyObjectsOnly) { Construct(gOLoginHistory, includeDirtyObjectsOnly); }
public GOLoginHistoryContainer(GOLoginHistoryDataObject gOLoginHistory) { Construct(gOLoginHistory, false); }