此查询适用于Entity Framework 6,但它不适用于Entity Framework Core。
这是我的查询
var fva = (from sa in efEntities.SifDenomination
join sva in efEntities.FormValueDenomination on sa.IdDenomination equals sva.IdDenomination
join bba in efEntities.TreasuryDenomination on
new { sa.IdDenomination, sa.IdCurrency, PostNumber = ((int)76300),DateWork=new DateTime(2017,3,6), SifTreasury = ((short)1) } equals
new { bba.IdDenomination, bba.IdCurrency, bba.PostNumber,bba.DateWork, bba.SifTreasury }
into gj
from bba in gj.DefaultIfEmpty()
where sa.IdCurrency == "978" && sa.IdActive == 0
select new
{
IdDenomination = sva.IdDenomination
}
).ToList();
错误讯息:
ORDER BY位置编号76300超出了选择列表中的项目数。在ORDER BY列表中遇到了一个常量表达式,位置为4。