/// <summary> Retrieves the related entity of type 'AuctionEventEntity', 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 'AuctionEventEntity' which is related to this entity.</returns> public virtual AuctionEventEntity GetSingleAuctionEvent(bool forceFetch) { if( ( !_alreadyFetchedAuctionEvent || forceFetch || _alwaysFetchAuctionEvent) && !base.IsSerializing && !base.IsDeserializing && !base.InDesignMode) { bool performLazyLoading = base.CheckIfLazyLoadingShouldOccur(RaffleEntity.Relations.AuctionEventEntityUsingEventId); AuctionEventEntity newEntity = new AuctionEventEntity(); if(base.ParticipatesInTransaction) { base.Transaction.Add(newEntity); } bool fetchResult = false; if(performLazyLoading) { fetchResult = newEntity.FetchUsingPK(this.EventId); } if(fetchResult) { if(base.ActiveContext!=null) { newEntity = (AuctionEventEntity)base.ActiveContext.Get(newEntity); } this.AuctionEvent = newEntity; } else { if(_auctionEventReturnsNewIfNotFound) { if(performLazyLoading || (!performLazyLoading && (_auctionEvent == null))) { this.AuctionEvent = newEntity; } } else { this.AuctionEvent = null; } } _alreadyFetchedAuctionEvent = fetchResult; if(base.ParticipatesInTransaction && !fetchResult) { base.Transaction.Remove(newEntity); } } return _auctionEvent; }
/// <summary>Creates a new, empty AuctionEventEntity object.</summary> /// <returns>A new, empty AuctionEventEntity object.</returns> public override IEntity Create() { IEntity toReturn = new AuctionEventEntity(); // __LLBLGENPRO_USER_CODE_REGION_START CreateNewAuctionEvent // __LLBLGENPRO_USER_CODE_REGION_END return toReturn; }
/// <summary> Initializes the class members</summary> private void InitClassMembers() { _auctionEvent = null; _auctionEventReturnsNewIfNotFound = true; _alwaysFetchAuctionEvent = false; _alreadyFetchedAuctionEvent = false; _user_ = null; _user_ReturnsNewIfNotFound = true; _alwaysFetchUser_ = false; _alreadyFetchedUser_ = false; _user = null; _userReturnsNewIfNotFound = true; _alwaysFetchUser = false; _alreadyFetchedUser = false; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
/// <summary> setups the sync logic for member _auctionEvent</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncAuctionEvent(IEntity relatedEntity) { if(_auctionEvent!=relatedEntity) { DesetupSyncAuctionEvent(true, true); _auctionEvent = (AuctionEventEntity)relatedEntity; base.PerformSetupSyncRelatedEntity( _auctionEvent, new PropertyChangedEventHandler( OnAuctionEventPropertyChanged ), "AuctionEvent", RaffleEntity.Relations.AuctionEventEntityUsingEventId, true, ref _alreadyFetchedAuctionEvent, new string[] { } ); } }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected RaffleEntity(SerializationInfo info, StreamingContext context) : base(info, context) { _auctionEvent = (AuctionEventEntity)info.GetValue("_auctionEvent", typeof(AuctionEventEntity)); if(_auctionEvent!=null) { _auctionEvent.AfterSave+=new EventHandler(OnEntityAfterSave); } _auctionEventReturnsNewIfNotFound = info.GetBoolean("_auctionEventReturnsNewIfNotFound"); _alwaysFetchAuctionEvent = info.GetBoolean("_alwaysFetchAuctionEvent"); _alreadyFetchedAuctionEvent = info.GetBoolean("_alreadyFetchedAuctionEvent"); _user_ = (UserEntity)info.GetValue("_user_", typeof(UserEntity)); if(_user_!=null) { _user_.AfterSave+=new EventHandler(OnEntityAfterSave); } _user_ReturnsNewIfNotFound = info.GetBoolean("_user_ReturnsNewIfNotFound"); _alwaysFetchUser_ = info.GetBoolean("_alwaysFetchUser_"); _alreadyFetchedUser_ = info.GetBoolean("_alreadyFetchedUser_"); _user = (UserEntity)info.GetValue("_user", typeof(UserEntity)); if(_user!=null) { _user.AfterSave+=new EventHandler(OnEntityAfterSave); } _userReturnsNewIfNotFound = info.GetBoolean("_userReturnsNewIfNotFound"); _alwaysFetchUser = info.GetBoolean("_alwaysFetchUser"); _alreadyFetchedUser = info.GetBoolean("_alreadyFetchedUser"); base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }
/// <summary> Removes the sync logic for member _auctionEvent</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 DesetupSyncAuctionEvent(bool signalRelatedEntity, bool resetFKFields) { base.PerformDesetupSyncRelatedEntity( _auctionEvent, new PropertyChangedEventHandler( OnAuctionEventPropertyChanged ), "AuctionEvent", RaffleEntity.Relations.AuctionEventEntityUsingEventId, true, signalRelatedEntity, "Raffle", resetFKFields, new int[] { (int)RaffleFieldIndex.EventId } ); _auctionEvent = null; }
/// <summary> Initializes the class members</summary> private void InitClassMembers() { _package = new Auction.Entities.CollectionClasses.PackageCollection(new PackageEntityFactory()); _package.SetContainingEntityInfo(this, "Bidder"); _alwaysFetchPackage = false; _alreadyFetchedPackage = false; _auctionEventCollectionViaPackage = new Auction.Entities.CollectionClasses.AuctionEventCollection(new AuctionEventEntityFactory()); _alwaysFetchAuctionEventCollectionViaPackage = false; _alreadyFetchedAuctionEventCollectionViaPackage = false; _categoryCollectionViaPackage = new Auction.Entities.CollectionClasses.CategoryCollection(new CategoryEntityFactory()); _alwaysFetchCategoryCollectionViaPackage = false; _alreadyFetchedCategoryCollectionViaPackage = false; _userCollectionViaPackage__ = new Auction.Entities.CollectionClasses.UserCollection(new UserEntityFactory()); _alwaysFetchUserCollectionViaPackage__ = false; _alreadyFetchedUserCollectionViaPackage__ = false; _userCollectionViaPackage_ = new Auction.Entities.CollectionClasses.UserCollection(new UserEntityFactory()); _alwaysFetchUserCollectionViaPackage_ = false; _alreadyFetchedUserCollectionViaPackage_ = false; _userCollectionViaPackage = new Auction.Entities.CollectionClasses.UserCollection(new UserEntityFactory()); _alwaysFetchUserCollectionViaPackage = false; _alreadyFetchedUserCollectionViaPackage = false; _auctionEvent = null; _auctionEventReturnsNewIfNotFound = true; _alwaysFetchAuctionEvent = false; _alreadyFetchedAuctionEvent = false; _user_ = null; _user_ReturnsNewIfNotFound = true; _alwaysFetchUser_ = false; _alreadyFetchedUser_ = false; _user = null; _userReturnsNewIfNotFound = true; _alwaysFetchUser = false; _alreadyFetchedUser = false; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
public void Update(ref Auction.Domain.Event auctionEvent, ref IAuctionTransaction trans) { using (var records = new AuctionEventCollection()) { var filter = new PredicateExpression(AuctionEventFields.Id == auctionEvent.Id); var evt = new AuctionEventEntity { AccountId = auctionEvent.Id, Name = auctionEvent.Name, Date = auctionEvent.Date, Locked = auctionEvent.Locked, Notes = auctionEvent.Notes, UpdatedBy = auctionEvent.UpdatedBy }; if (trans != null) { trans.Add(records); } records.UpdateMulti(evt, filter); } }
public void Insert(ref Auction.Domain.Event auctionEvent, ref IAuctionTransaction trans) { var evt = new AuctionEventEntity { AccountId = auctionEvent.Id, Name = auctionEvent.Name, Date = auctionEvent.Date, Locked = auctionEvent.Locked, Notes = auctionEvent.Notes, UpdatedBy = auctionEvent.UpdatedBy }; if (trans != null) { trans.Add(evt); } evt.Save(); }
/// <summary> Initializes the class members</summary> private void InitClassMembers() { _donation = new Auction.Entities.CollectionClasses.DonationCollection(new DonationEntityFactory()); _donation.SetContainingEntityInfo(this, "Package"); _alwaysFetchDonation = false; _alreadyFetchedDonation = false; _auctionEventCollectionViaDonation = new Auction.Entities.CollectionClasses.AuctionEventCollection(new AuctionEventEntityFactory()); _alwaysFetchAuctionEventCollectionViaDonation = false; _alreadyFetchedAuctionEventCollectionViaDonation = false; _donorCollectionViaDonation = new Auction.Entities.CollectionClasses.DonorCollection(new DonorEntityFactory()); _alwaysFetchDonorCollectionViaDonation = false; _alreadyFetchedDonorCollectionViaDonation = false; _userCollectionViaDonation_ = new Auction.Entities.CollectionClasses.UserCollection(new UserEntityFactory()); _alwaysFetchUserCollectionViaDonation_ = false; _alreadyFetchedUserCollectionViaDonation_ = false; _userCollectionViaDonation = new Auction.Entities.CollectionClasses.UserCollection(new UserEntityFactory()); _alwaysFetchUserCollectionViaDonation = false; _alreadyFetchedUserCollectionViaDonation = false; _auctionEvent = null; _auctionEventReturnsNewIfNotFound = true; _alwaysFetchAuctionEvent = false; _alreadyFetchedAuctionEvent = false; _bidder = null; _bidderReturnsNewIfNotFound = true; _alwaysFetchBidder = false; _alreadyFetchedBidder = false; _category = null; _categoryReturnsNewIfNotFound = true; _alwaysFetchCategory = false; _alreadyFetchedCategory = false; _user__ = null; _user__ReturnsNewIfNotFound = true; _alwaysFetchUser__ = false; _alreadyFetchedUser__ = false; _user_ = null; _user_ReturnsNewIfNotFound = true; _alwaysFetchUser_ = false; _alreadyFetchedUser_ = false; _user = null; _userReturnsNewIfNotFound = true; _alwaysFetchUser = false; _alreadyFetchedUser = false; PerformDependencyInjection(); // __LLBLGENPRO_USER_CODE_REGION_START InitClassMembers // __LLBLGENPRO_USER_CODE_REGION_END OnInitClassMembersComplete(); }
/// <summary>Private CTor for deserialization</summary> /// <param name="info"></param> /// <param name="context"></param> protected PackageEntity(SerializationInfo info, StreamingContext context) : base(info, context) { _donation = (Auction.Entities.CollectionClasses.DonationCollection)info.GetValue("_donation", typeof(Auction.Entities.CollectionClasses.DonationCollection)); _alwaysFetchDonation = info.GetBoolean("_alwaysFetchDonation"); _alreadyFetchedDonation = info.GetBoolean("_alreadyFetchedDonation"); _auctionEventCollectionViaDonation = (Auction.Entities.CollectionClasses.AuctionEventCollection)info.GetValue("_auctionEventCollectionViaDonation", typeof(Auction.Entities.CollectionClasses.AuctionEventCollection)); _alwaysFetchAuctionEventCollectionViaDonation = info.GetBoolean("_alwaysFetchAuctionEventCollectionViaDonation"); _alreadyFetchedAuctionEventCollectionViaDonation = info.GetBoolean("_alreadyFetchedAuctionEventCollectionViaDonation"); _donorCollectionViaDonation = (Auction.Entities.CollectionClasses.DonorCollection)info.GetValue("_donorCollectionViaDonation", typeof(Auction.Entities.CollectionClasses.DonorCollection)); _alwaysFetchDonorCollectionViaDonation = info.GetBoolean("_alwaysFetchDonorCollectionViaDonation"); _alreadyFetchedDonorCollectionViaDonation = info.GetBoolean("_alreadyFetchedDonorCollectionViaDonation"); _userCollectionViaDonation_ = (Auction.Entities.CollectionClasses.UserCollection)info.GetValue("_userCollectionViaDonation_", typeof(Auction.Entities.CollectionClasses.UserCollection)); _alwaysFetchUserCollectionViaDonation_ = info.GetBoolean("_alwaysFetchUserCollectionViaDonation_"); _alreadyFetchedUserCollectionViaDonation_ = info.GetBoolean("_alreadyFetchedUserCollectionViaDonation_"); _userCollectionViaDonation = (Auction.Entities.CollectionClasses.UserCollection)info.GetValue("_userCollectionViaDonation", typeof(Auction.Entities.CollectionClasses.UserCollection)); _alwaysFetchUserCollectionViaDonation = info.GetBoolean("_alwaysFetchUserCollectionViaDonation"); _alreadyFetchedUserCollectionViaDonation = info.GetBoolean("_alreadyFetchedUserCollectionViaDonation"); _auctionEvent = (AuctionEventEntity)info.GetValue("_auctionEvent", typeof(AuctionEventEntity)); if(_auctionEvent!=null) { _auctionEvent.AfterSave+=new EventHandler(OnEntityAfterSave); } _auctionEventReturnsNewIfNotFound = info.GetBoolean("_auctionEventReturnsNewIfNotFound"); _alwaysFetchAuctionEvent = info.GetBoolean("_alwaysFetchAuctionEvent"); _alreadyFetchedAuctionEvent = info.GetBoolean("_alreadyFetchedAuctionEvent"); _bidder = (BidderEntity)info.GetValue("_bidder", typeof(BidderEntity)); if(_bidder!=null) { _bidder.AfterSave+=new EventHandler(OnEntityAfterSave); } _bidderReturnsNewIfNotFound = info.GetBoolean("_bidderReturnsNewIfNotFound"); _alwaysFetchBidder = info.GetBoolean("_alwaysFetchBidder"); _alreadyFetchedBidder = info.GetBoolean("_alreadyFetchedBidder"); _category = (CategoryEntity)info.GetValue("_category", typeof(CategoryEntity)); if(_category!=null) { _category.AfterSave+=new EventHandler(OnEntityAfterSave); } _categoryReturnsNewIfNotFound = info.GetBoolean("_categoryReturnsNewIfNotFound"); _alwaysFetchCategory = info.GetBoolean("_alwaysFetchCategory"); _alreadyFetchedCategory = info.GetBoolean("_alreadyFetchedCategory"); _user__ = (UserEntity)info.GetValue("_user__", typeof(UserEntity)); if(_user__!=null) { _user__.AfterSave+=new EventHandler(OnEntityAfterSave); } _user__ReturnsNewIfNotFound = info.GetBoolean("_user__ReturnsNewIfNotFound"); _alwaysFetchUser__ = info.GetBoolean("_alwaysFetchUser__"); _alreadyFetchedUser__ = info.GetBoolean("_alreadyFetchedUser__"); _user_ = (UserEntity)info.GetValue("_user_", typeof(UserEntity)); if(_user_!=null) { _user_.AfterSave+=new EventHandler(OnEntityAfterSave); } _user_ReturnsNewIfNotFound = info.GetBoolean("_user_ReturnsNewIfNotFound"); _alwaysFetchUser_ = info.GetBoolean("_alwaysFetchUser_"); _alreadyFetchedUser_ = info.GetBoolean("_alreadyFetchedUser_"); _user = (UserEntity)info.GetValue("_user", typeof(UserEntity)); if(_user!=null) { _user.AfterSave+=new EventHandler(OnEntityAfterSave); } _userReturnsNewIfNotFound = info.GetBoolean("_userReturnsNewIfNotFound"); _alwaysFetchUser = info.GetBoolean("_alwaysFetchUser"); _alreadyFetchedUser = info.GetBoolean("_alreadyFetchedUser"); base.FixupDeserialization(FieldInfoProviderSingleton.GetInstance(), PersistenceInfoProviderSingleton.GetInstance()); // __LLBLGENPRO_USER_CODE_REGION_START DeserializationConstructor // __LLBLGENPRO_USER_CODE_REGION_END }