私のSQLコードは次のとおりです。LINQ同等のSQLクエリは
select UserId,UserName
from aspnet_Users
where UserId not in (select UsersId from tbluser where active='true')
同等のLINQ表現が何でありますか?
私のSQLコードは次のとおりです。LINQ同等のSQLクエリは
select UserId,UserName
from aspnet_Users
where UserId not in (select UsersId from tbluser where active='true')
同等の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};
SOURCE
私はそれが 'x.active'だと思います –
@Sahuaginうん、ありがとう。 –
+1。 –
var query =
from c in aspnet_Users
where !(from o in tbluser where o.active=="true"
select o.UserId)
.Contains(c.UserId)
select c;
あなたの**コピー**は@JWの回答とどう違うのですか? –
私は@jwの回答を見ていない、私の答えを投稿した後、私は両方が同じであることを知りに来た。 – LNRao
'!aspnet_Users.Any(p => p.active ==" true ")'は同じようには見えません。私はここに何かを逃していますか –
で
LiNQ
を使用して、私の最初の試みが!.Contains()または.Exceptは、()I「は2つの方法があり'VB'または' C# 'に – dougajmcdonaldを認識していますか? –