我有一个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))