I have a parameter list of strings and I want to write a query that returns a list of strings that contain values of the parameter list that are present in the table. I have the
Based on Contain's Documentation the parameter for Contains could be string not a list of string. So it should be like this:
List TheListParameter = new List {"string1", "string2", "string3"};
var TheOutput = (from t in MyDC.SomeTable
where TheListParameter.Contains(t.SomeColumn.ToString())
select t.SomeColumn).ToList();
Or if you want to return a boolean result if MyDC.SomeTable.SomeColumn contains one of the TheListParameter's strings you can try something like this:
bool hasSameElements = MyDC.SomeTable.ToList()
.Select(c => c.SomeColumn)
.Intersect(TheListParameter).Any(); //True or False