SQL Server"in"等效于.Net

Nas*_*ash 3 c#

我有兴趣学习:

Select * from Customer where CustomerId in(12,23,45);
Run Code Online (Sandbox Code Playgroud)

同样,上面有相同的C#.Net关键字吗?

示例:验证日期(月)不在十月,十一月十二月(不在SQL或LINQ中)

我用扩展方法(三元运算符||通过用月验证)做到了我正在寻找简单的方法来验证,如果存在的话.

the*_*ric 11

Threre不是关键字,但您可以使用以下构造:

using System.Linq;
...
(new [] {12, 23, 45}).Contains(customerID)
Run Code Online (Sandbox Code Playgroud)