I am working with a C# List on which I am performing some LINQ query in a C# windows application and I came across a situation where I have to pass a list of strings to a where clause in the LINQ query similar to WHERE Product NOT IN ('sa','as')
in SQL
, but I am not exactly sure how I can implement in LINQ and pass List of Strings to the query.
FOr a single parameter I am using the following code
var hiddenProductList = recordsToProcess.Where(x => x.Product != product).ToList();
now I have a list named listProducts
and I want to pass this to above query in where
and get the results
Is there any way I can implement this?