Closed. This question needs details or clarity。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗?添加详细信息并通过editing this post阐明问题。
                        
                        6年前关闭。
                                                                                            
                
        
     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 };


这是编译器从上述查询表达式生成的代码:

var result = a1.SelectMany(
      c1 => a1.a2.SelectMany(
         c2 => a1.a2.a3.Select(
            c3 => new {c1,c2,c3})));


谢谢

最佳答案

你是对的。

这是一个完整的外部联接,将包含a1.Count * a2.Count * a3.Count个项目,包括源序列/

关于c# - 这是编译器从以下查询表达式生成的代码吗? ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/7380194/

10-13 05:56