Up to now, when doing join operation in LINQ, I have no idea how to decide which list must come first and which list must come after. Assume I have two list, List<Product> and List<Order>.
Edit:
My confusion is to decide
List<Product>.Join(List<Order>, ...)
or
List<Order>.Join(List<Product>, ...)
?
Enumerable.Joinperforms an inner, equijoin. From MSDN:Consequently, the choice of which sequence is deemed to be the ‘outer’ one has no impact on the items that will be present in the result of the query. All
(outer, inner)pairs for which their respective projections are equal will make their way in.However, there will be an impact in terms of the sequencing of items in the result. From MSDN:
Another trivial point is that switching ‘outer’ and ‘inner’ will mean the order of the delegate arguments will have to be swapped as well.