本文介绍了请解释此Linq查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
任何人都可以解释一下此msdn链接中给出的以下LINQ查询.
查询是:

Hi there,
Can any one please explain the following LINQ query given in this msdn link.
The query is:

public void Linq19()
{
    List<Customer> customers = GetCustomerList();
    var customerOrders =
        customers.SelectMany(
            (cust, custIndex) =>
            cust.Orders.Select(o => "Customer #" + (custIndex + 1) +
                                    " has an order with OrderID " + o.OrderID));
    ObjectDumper.Write(customerOrders);
}





http://msdn.microsoft.com/en-us/vcsharp/aa336758#SelectSimple1 [ ^ ]





http://msdn.microsoft.com/en-us/vcsharp/aa336758#SelectSimple1[^]

推荐答案


这篇关于请解释此Linq查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-31 07:16