Is this the code the compiler generates from the following query expression? [closed]
Want to improve this que开发者_JAVA技巧stion? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question var result = from c1 in a1
from c2 in a1.a2
from c3 in a1.a2.a3
select new { c1.id, c2.id, c3.id };
Is this the code the compiler generates from the above query expression:
var result = a1.SelectMany(
c1 => a1.a2.SelectMany(
c2 => a1.a2.a3.Select(
c3 => new {c1,c2,c3})));
thank you
You are correct.
This is a full outer join and will contain a1.Count * a2.Count * a3.Count
items, including every combination of items from the source sequences/
精彩评论