先看代码
List<Expression<Func<VIEW_EVENT,bool>>> expList=new List<Expression<Func<VIEW_EVENT,bool>>>();
expList.Add((ent=>ent.AreaId==1));
expList.Add((ent => ent.PlayerName == "mht"));
expList.Add((ent => ent.PlayerTel == "9283784"));
我想把list里的表达式合并为一个,相当于SQL 的and一样,怎么做?我是想构建动态查询。谢谢!
expList.Add((ent=>ent.AreaId==1&&ent.PlayerName == "mht“&&ent.PlayerTel == "9283784”));