其他分享
首页 > 其他分享> > 【Linq】链表时多条件

【Linq】链表时多条件

作者:互联网

SQL语句:

SELECT * FROM dbo.PlatformUserOrg A
LEFT JOIN dbo.BusinessPlatformAccount B ON A.AppId=B.AppId AND A.OrgCode=B.Account
WHERE B.AccountType=0

Linq写法:

from orgInfo in db.PlatformUserOrgs
join accountInfo in db.BusinessPlatformAccounts on new { appId = orgInfo.AppId, orgCode = orgInfo.OrgCode } equals new { appId = accountInfo.AppId, orgCode = accountInfo.Account }
into accountResult
from account in accountResult.DefaultIfEmpty()
select orgInfo

 

 

搜索

复制

<iframe height="240" width="320"></iframe>

标签:dbo,orgInfo,Linq,链表,accountInfo,AppId,new,时多
来源: https://www.cnblogs.com/zhaoyl9/p/16461913.html