How to add an in command to a where clause in LINQ? -
if have clause follows:
where item.field == "value" how can change statement in linq be:
item.field in ("value1","value2","value3") seems simple, not working.
thanks in advance
declare "in" values collection in variable first:
var collection = new[] { "value1","value2","value3" }; and use in query:
... collection.contains(item.field) ...
Comments
Post a Comment