学习笔记11 EF查询相当于sql 中的 where in

两种写法  

1、

 int[] Ids={1,2,3}

DBContainer db=new DBContainer();

var list=db.表明.where(a=>Ids.Contains(a.列名))

 

2、

 

int[] Ids={1,2,3}

DBContainer db=new DBContainer();

var list=from r db.表明

     where Ids.Container(r.列名)

      select r;

posted @ 2018-04-05 18:17  Zero77  阅读(557)  评论(0编辑  收藏  举报