【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