0

请为mysql查询形成一个LINQ查询

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;

请帮帮我谢谢

4

1 回答 1

3

根本没有测试过,但这些行中的某些东西应该可以工作......

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 };
于 2012-07-15T17:14:10.633 回答