NHibernate lazy loading nested collections with futures to avoid N+1 problem
问题 I have an object model that looks like this (pseudo code): class Product { public ISet<Product> Recommendations {get; set;} public ISet<Product> Recommenders {get; set;} public ISet<Image> Images {get; set; } } When I load a given product and want to display the images of its recommendations, I run into an N+1 problem. (The recommendations are lazy-loaded, then a loop calls the .Images property of each one.) Product -> Recommendations -> Images What I want to do is eagerly load this