我有一个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))
选定的详细信息集合项中没有 idcodesarray
:
detailcollection.Where (x=> !codesarray.Contains(x.ope_idsku))
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)