/// <summary> Retrieves the related entity of type 'OfferingEntity', 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 'OfferingEntity' which is related to this entity.</returns> public virtual OfferingEntity GetSingleOffering(bool forceFetch) { if ((!_alreadyFetchedOffering || forceFetch || _alwaysFetchOffering) && !this.IsSerializing && !this.IsDeserializing && !this.InDesignMode) { bool performLazyLoading = this.CheckIfLazyLoadingShouldOccur(Relations.OfferingEntityUsingOfferingId); OfferingEntity newEntity = new OfferingEntity(); bool fetchResult = false; if (performLazyLoading) { AddToTransactionIfNecessary(newEntity); fetchResult = newEntity.FetchUsingPK(this.OfferingId); } if (fetchResult) { newEntity = (OfferingEntity)GetFromActiveContext(newEntity); } else { if (!_offeringReturnsNewIfNotFound) { RemoveFromTransactionIfNecessary(newEntity); newEntity = null; } } this.Offering = newEntity; _alreadyFetchedOffering = fetchResult; } return(_offering); }