【发布时间】:2018-05-17 18:32:31
【问题描述】:
我有一个detailcollection 集合,其中的每个细节都有
code, price, name
还有一个带有一些代码的字符串
string codes = "1,2,3";
我知道我可以使用 string.Split() 获得一个数组
string[] codesarray = codes.Split(',');
但是我怎样才能得到不在codes 中的产品呢?
// the idea I have, but I would not like to have a loop
for (int i = 0; i < codesarray.Length; i++)
{
detailcollection.Where(x => x.ope_idsku == codesarray[i])
}
我想要类似的东西:
detailcollection.Where(x => x.ope_idsku not in (codesarray))
【问题讨论】:
标签: c# compact-framework lambda