我写了一个小查询,在 Linqpad 中运行良好,但是(见下文)关税不作为 Iqueryable 返回,有谁知道如何解决这个问题?
基本上看关税=新......,
from v in House
join gvt in
(from t in MyTariffs where t.Id == 3 select t)
on v.IdTariff equals gvt.Id
select new
{
Id = v.Id,
Tariffs = new
{
Deposit = gvt.CurrentDeposit
}
}
我确实尝试过,但它无效,因为 gvt 不是表格或其他东西?
from v in House
join gvt in
(from t in MyTariffs where t.Id == 3 select t)
on v.IdTariff equals gvt.Id
select new
{
Id = v.Id,
Tariffs = from x in gvt // NOTICE i am doing from x in gvt... But it fails..
select new
{
Deposit = gvt.CurrentDeposit
}
}
当然 gvt 只包含我想要的值,因为它有内部连接......
我可以直接从我的 MyTariffs 中提取(它可以返回 Iqueryable)但是我有太多信息,因为它没有考虑到我在 gvt 中所做的加入?
from v in House
join gvt in
(from t in MyTariffs where t.Id == 3 select t)
on v.IdTariff equals gvt.Id
select new
{
Id = v.Id,
Tariffs = from x in MyTariffs // THIS has nothing to do with my join
select new
{
Deposit = gvt.CurrentDeposit
}
}