var qurry = from bind in repDb.DbQuery.Where(p => p.PrescriptionInfo.DecocteScheme.DecocteSchemeDetails.Select(q => q.DecocteType).Contains(DecoctMethod.BackDown)
&& p.PrescriptionInfo.PreDetails.Select(q => q.Method).Contains(PDecoctMethod.Last)
&& p.DispenseTask.IsPutedLastDrug==null )
join boil in repBB.DbQuery.Where(p=>p.IsLastDrugPosi==null)
on bind.BucketId equals boil.BucketId
select new
{
LastDrugsWeight = (from dsd in disSub.DbQuery.Where(c => c.PrescriptionId == bind.PrescriptionInfo.Id)
join preDetail in bind.PrescriptionInfo.PreDetails.Where(p => p.Method == PDecoctMethod.Last)
on dsd.DrugId equals preDetail.DrugId
orderby dsd.DrugId ascending
select new
{
PrescriptionWeight = dsd.PrescriptionWeight,
LastDrugs = dsd.Drug.Name
}).ToList(),
TotalTime = bind.PrescriptionInfo.DecocteScheme.DecocteSchemeDetails.FirstOrDefault(p => p.DecocteType == DecoctMethod.FryOne).Time,
};
var a= qurry.ToList();
执行上面语句时出现 “Oracle 11.2.0.4.0 不支持 APPLY”错误
下面是修改后的语句就可以成功查询,个人猜测可能是linq与EF混用导致的,至于具体原因还请各位大神指教一二,谢谢
var qurry = from bind in repDb.DbQuery.Where(p => p.PrescriptionInfo.DecocteScheme.DecocteSchemeDetails.Select(q => q.DecocteType).Contains(DecoctMethod.BackDown)
&& p.PrescriptionInfo.PreDetails.Select(q => q.Method).Contains(PDecoctMethod.Last)
&& p.DispenseTask.IsPutedLastDrug==null )
join boil in repBB.DbQuery.Where(p=>p.IsLastDrugPosi==null)
on bind.BucketId equals boil.BucketId
select new
{
LastDrugsWeight = (from dsd in disSub.DbQuery
join preDetail in bind.PrescriptionInfo.PreDetails
on dsd.DrugId equals preDetail.DrugId
orderby dsd.DrugId ascending
where dsd.PrescriptionId== bind.PrescriptionInfo.Id && preDetail.Method== PDecoctMethod.Last
select new
{
PrescriptionWeight = dsd.PrescriptionWeight,
LastDrugs = dsd.Drug.Name
}).ToList(),
TotalTime =from desc in bind.PrescriptionInfo.DecocteScheme.DecocteSchemeDetails where desc.DecocteType == DecoctMethod.FryOne select desc.Time,
};
var a= qurry.ToList();