Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6885831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:41:02+00:00 2026-05-27T05:41:02+00:00

I want my application to work without lazy load by default. However in some

  • 0

I want my application to work without lazy load by default. However in some cases (which I want to set explicitly) I need lazy loading.

So, my default conventions are (last line swithes off default lazy loading):

Fluently.Configure().Database(driverConfig)
            .Mappings(m => m
                .FluentMappings.AddFromAssemblyOf<Limit>()
                .Conventions.AddFromAssemblyOf<Limit>()
                .Conventions.Add(PrimaryKey.Name.Is(x => x.EntityType.Name + "Id"))
                .Conventions.Add(DefaultCascade.All())
                .Conventions.Add(ForeignKey.EndsWith("Id"))
                .Conventions.Add(ConventionBuilder.Id.Always(x => x.GeneratedBy.Native()))
                .Conventions.Add(ConventionBuilder.Id.Always(x => x.Unique()))
                .Conventions.Add(Cache.Is(x => x.NonStrictReadWrite()))
                .Conventions.Add(DefaultLazy.Never())

And I want this Many relation to be lazy loaded:

        HasMany(x => x.TestCaseOrdered).KeyColumn("ProductVariantId").LazyLoad();

However, it isn’t lazy loaded. I tried to replace DefaultLazy.Never() convention with LazyLoad.Never() but it doesn’t work (and I cannot understand the difference).

How can I easily switch off lazy loading for all cases except one concrete?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:41:03+00:00Added an answer on May 27, 2026 at 5:41 am

    I was retrieving tests with code:

     using (ISession session = GetSessionFactory().OpenSession())
            {
                // TODO: Criteria + lazy
                var productVariants = session.CreateCriteria<ProductVariant>().List<ProductVariant>().ToArray();
    
                // TODO: Lazy loading should be available
                foreach (var product in productVariants)
                {
                    var testCaseDataOrders = product.TestCaseOrdered.ToList();
                    testCaseDataOrders.Select(x => x.TestCaseData.Id);
                }
    
                return productVariants;
            }
    

    That was the problem

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make an Application that uses RxTx version 2.2pre2 to work with
I want my application to have a zoomable element which will allow the XAML
I want in an application with a simple text input, enriched with some marks
I have VS 2008 and I want my application to work with Windows 98
For a scientific application I want to design an input form which lets the
I want to make a progress bar for my terminal application that would work
I want my application to clean all the temp files it used, the problem
I want my application to encrypt a user password, and at one time password
I have several thread pools and I want my application to handle a cancel
I have an application and executables. I want my application to run my executables.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.