2

你如何编写一个linq 查询来表达这一点:

Select * from Table
where column IN (some values);

通过某些值,我的意思是('Value1', 'Value2', 'value3', ...)

感谢您的帮助

4

1 回答 1

6

假设

var some_values = new [] { "Value1", "Value2", "value3" };

然后:

data.Where(x => some_values.Contains(x))

或者:

from x in data
where some_values.Contains(x)
select x;
于 2013-05-12T19:11:57.893 回答