c# - LINQ to SQL in and not in -
Is
in in
and is not
? Choose
for example
from ... in the table (...) and * not in the table (..)
What's the above statement from LINQ to SQL?
You use, where & lt; List & gt; . (& Lt; Items & gt;)
var myProducts = d into p Select product where productList.Contains (p.ProductID) p;
Or you can predefine a list like:
var ids = {1, 2, 3}; Var query = item in context. Select the item where the id. Compatibility (item.id);
For the 'NOT' case, just '!' Operator 'included' statement before
Comments
Post a Comment