Linq里注意的东西

LINQ 中IN的用法

IN:

C#

var result = 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;

原文地址:https://www.cnblogs.com/chencidi/p/2140350.html