我的SQL代码如下:
select UserId,UserName from aspnet_Users where UserId not in (select UsersId from tbluser where active='true')
等效的linq表达式是什么?
我第一次尝试LiNQ在C#
LiNQ
C#
var result = from y in aspnet_Users where !( from x in tblUser where x.active == "true" select x.UsersID ).Contains(y.UserId) select y; -- OR // select new { y.UserId, y.UserName};
来源