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

  • SEARCH
  • Home
  • 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 6149039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:23:10+00:00 2026-05-23T19:23:10+00:00

I am using NHibernate and Linq to NHibernate (mostly the same as Linq to

  • 0

I am using NHibernate and Linq to NHibernate (mostly the same as Linq to SQL). What would I do to get the following:

I have class Garage, which has lots of Cars in it. I want to search Cars by year of manufacture, and also return the garage each car is in.

To get the cars, I do something like:

from item in session.Query<Car>()
where item.year == 2011
select item

The car class does not have garageID, the garage just has a collection of cars.

  • 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-23T19:23:11+00:00Added an answer on May 23, 2026 at 7:23 pm

    It’s called eager loading, check out this article http://mikehadlow.blogspot.com/2010/08/nhibernate-linq-eager-fetching.html

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

Sidebar

Related Questions

i have the following code using Nhibernate.Linq var apps = Session.Linq<History>().OrderByDescending(r => r.LastUpdated).Take(50); Console.Write(apps.Count());
I am using Linq to NHibernate. I have a following test case : [TestMethod]
I have an NHibernate Linq query which isn't working how I would expect. The
I'm using NHibernate 3.2 and have the following model: class User { public virtual
I'm using NHibernate 2.1 with the LINQ provider and the results I get back
I have a problem using Linq to NHibernate to load an object and eagerly
I query my NHibernate datasources using a Linq Expression. The problem I have with
I am using NHibernate with NHibernate.Linq, and have a bunch of dynamically loading modules
I am using NHibernate(2.0.1.4) with NHibernate.Linq(1.0.0.4) to get Objects of the type Node from
In a .Net project in which I'm using NHibernate, I have a piece of

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.