Quantcast
Viewing all articles
Browse latest Browse all 3

Answer by tofi9 for Linq to Sql Many-One relationship

This is the n+1 problem. nHibernate has a solution for this, which is called join-fetch querying. What it basically does is a outer-join query between order and order-line, which will result in the product of the row counts of the two tables.

I don't think Linq2SQL does have a solution for it. But you can still use your stored procedure to generate the join-fetch output, and have some Linq2Objects code to distinct the unique orders and the order-lines out of the result.


Viewing all articles
Browse latest Browse all 3

Trending Articles