I have a detailcollection
collection in which every detail has
code, price, name
And a string with some codes
string codes = "1,2,3";
I know I can get an array using string.Split()
string[] codesarray = codes.Split(',');
But how can I get products not in 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])
}
I would like something like:
detailcollection.Where(x => x.ope_idsku not in (codesarray))
Selected details collection items which ids are not in codesarray
:
detailcollection.Where (x=> !codesarray.Contains(x.ope_idsku))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With