我有以下SQL查询:
select MFSOAM_SubAccountNbr, MFSOAM_Description, 0 as OK, MFSOAM_SubAccountNbr
from MFSOAM
left join MFSOA on MFSOA_Account=MFSOAM_SubAccountNbr
and MFSOA_Acc='1.1.01'
where MFSOA_Acc is null
order by OK, MFSOA.MFSOA_Account
字符串
然后我从上面的查询创建一个Linq,类似于:
var model2 = await (from a in _context.Mfsoams
join b in _context.Mfsoas on new { a.MfsoamSubAccountNbr } equals new { b.MfsoaAccount, jon = b.MfsoaAcc == request.Account } into ab
from c in ab.DefaultIfEmpty()
where c.MfsoaAcc == null
select new
{
Acc = a.MfsoamSubAccountNbr,
Desc = a.MfsoamDescription,
OK = 0,
Acc2 = a.MfsoamSubAccountNbr,
Acc3 = c.MfsoaAcc
}).OrderBy(o => o.OK).ThenBy(o => o.Acc3).ToListAsync(cancellationToken);
型
但是join
单词上有个错误,它说join子句不正确。
请指教。
- 谢谢-谢谢
1条答案
按热度按时间acruukt91#
相等的LHS与联接中相等的RHS的类型不同。
LHS类型为
字符串
RHS类型为
型
没有明显的方法可以在这两种类型上执行EQUALS。
我猜你想
型