Lambda表达式中的in操作

//首先,在程序中接受一个数组
例如:int[] s=[1,2,3];
//在Lamda表达式中使用如下:
db.userinfo.where(u=>s.Contains(u.id));
//等同于sql语句:
select * from userinfo where id in (1,2,3)
原文链接:https://blog.csdn.net/qq_39569480/article/details/105249292

posted @ 2023-09-13 13:55  C#HelloWord!!!  阅读(367)  评论(0)    收藏  举报