4
我期待从Linq返回查询结果,以便将ID传递给查询。因此,这将是这个样子:如何按照我提供的ID顺序从Linq查询中获取结果?
var IDs = new int [] { 5, 20, 10 }
var items = from mytable in db.MyTable
where IDs.Contains(mytable.mytableID)
orderby // not sure what to do here
select mytable;
我希望得到的IDs
(5,20,10)的订单项目。
(请注意,这类似于this question,但我想这样做的LINQ的,而不是SQL)
它的LINQ没有链接;) – 2010-05-26 22:42:38
@Abe-谢谢你的追捕! – Keltex 2010-05-26 23:45:57
愚蠢的拼写检查软件 – ecounysis 2010-05-27 04:55:43