我正在构建此方法,该方法从表中返回值列表。
public IQueryable<RRSlotFiltriXDatiAggregatiElaborati> getTimeDomainTable(int idFiltri, int idTipoElaborazione)
{
return from f in dbData.RRSlotFiltriXDatiAggregatiElaborati
where f.IdRRSlotFiltri == idFiltri && f.idTipoElaborazione == idTipoElaborazione
select new RRSlotFiltriXDatiAggregatiElaborati
{
ID = f.ID,
IdRRSlotFiltri = f.IdRRSlotFiltri,
PHR_CCD_Units = (from u in dbData.PHR_CCD_Units
where u.ID == f.idUm
select new PHR_CCD_Units()
{
Code = u.Code,
CodeSystem = u.CodeSystem,
CodeSystemName = u.CodeSystemName
}).FirstOrDefault(),
RRParametri = (from p in dbData.RRParametri
where p.ID == f.idParametro
select new RRParametri()
{
ID = p.ID,
Descrizione = p.Descrizione
}).FirstOrDefault(),
valore = f.valore
};
}
现在,我想将此可疑对象列表。如果我尝试执行此行代码:
var iq = getTimeDomainTable(1, 1).toList();
我遇到此错误:
System.NotSupportedException:'实体或复杂类型'dbname.RRSlotFiltriXDatiAggregatiElaborati'不能在LINQ to Entities查询中构建。'
我该如何解决?