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;

posted @ 2011-08-16 11:01  陈同学  阅读(162)  评论(0编辑  收藏  举报