问题
please form a LINQ query for the mysql query
select a.name ,a.amount
from acount as a
where a.acountid NOT IN (select c.id from saving as c where c.userid="x")
and a.userid="x";
X=1;
Please help me out Thanks
回答1:
Have not tested at all but something in these lines should work...
var query =
from a in db.Account
where !(from s in db.Savings
where s.UserId == "x"
select s.id)
.Contains(a.AccountId)
&& a.UserId == "x"
select new { a.Name, a.Amount };
来源:https://stackoverflow.com/questions/11493861/sql-to-linq-conversion-with-not-in