我有以下Linq查询:Linq错误 - “NotSupportedException:用于查询运算符的不支持的重载'选择'”
var tmp =
from container in Container
join containerType in ContainerType on container.ContainerType equals containerType
where containerType.ContainerTypeID == 2
select new { ContainerID = container.ContainerID, TypeID = container.ContainerTypeID};
var results = tmp.Select((row, index) => new { row.ContainerID, row.TypeID, ContainerIndex = index })
原样,这个工作正常。如果我添加以下内容,那么我可以在LinqPad中看到结果,我得到了此消息标题中描述的错误:
results.Dump();
此错误不是LinqPad错误,它来自Linq,我不喜欢不明白这意味着什么。
谢谢。
也看到我对乔恩的回答评论你刚才的问题。 – 2010-07-07 12:39:05