IN:
C#
var result = from s1 in context.Customers where (new string[]
{ "UK", "Lisboa" }).Contains(s1.City) select s1;
VB.NET
Dim lists = From s1 In context.Customers Where (New String() {"UK", "Lisboa"}).Contains(s1.City) Select s1
NOT IN:
C#
var result = from s1 in context.Customers where !(new string[] { "UK", "Lisboa" }).Contains(s1.City) select s1;
VB.NET
Dim lists = From s1 In context.Customers Where Not (New String() {"UK", "Lisboa"}).Contains(s1.City) Select s1
本文转自dotfun 51CTO博客,原文链接:http://blog.51cto.com/dotfun/286029