【发布时间】:2014-04-01 19:25:51
【问题描述】:
我有这两个接口:
public interface IShipment
{
IEnumerable<IShippedItem> Contents { get; }
string InvoiceNumber { get; }
}
public interface IShippedItem
{
string ProductCode { get; }
int Quantity { get; }
}
现在,我正在尝试编写 LINQ 语句来获取 ProductCode 的列表。
如何解决这个问题?
IEnumerable<IShipment> shipments = GetShipments();
var productCodeList = from shipment in shipment
???????
【问题讨论】:
标签: c# linq c#-4.0 ienumerable ilist