Created
March 19, 2011 15:18
-
-
Save Meligy/877532 to your computer and use it in GitHub Desktop.
How to eager load Child Collections (Ex: Blog.Post.Comments) Directly Using QueryOver In NHibernate 3.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
session.QueryOver<Blog>() | |
.Fetch(b => b.Posts).Eager // If you don't add this, the following will not work | |
.Fetch(b => b.Posts.First().Comments).Eager // The trick here is using ".First()" after the collection | |
.List(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result Query (SQL CE 4.0):