LinqToSQL 我在从组中选择一列时遇到问题,下面是我的查询
var qry = (from i in INTERNETDATAs
join c in COVERS on Convert.ToInt32(i.COVERTYPE) equals c.COV_TYPE
join b in BENEFITS on c.COVERID equals b.COVERID
join p in POLICies on i.REFERENCENO equals p.BACS_POLNO into grp
where i.DATELOADED >= new DateTime(2013,1,1)
&& i.DATELOADED < new DateTime(2014,1,1)
&& i.CAMPAIGNTYPE == "1"
&& c.COVERTYPEID == 17063789
orderby i.DOB
select new
{
i.ID,
Campaign = i.CAMPAIGNTYPE,
Title = i.TITLE,
Dob = i.DOB,
Accepted = i.ACCEPTED,
BankLetter = i.BANKLETTER,
//p.STATUS,
//grp.STATUS,
MonthlyPremium = c.MONTHLYPREMIUM,
BenefitAmount = b.BENEFITAMOUNT,
Description = b.BENEFITDESCRIPTION
}
).DefaultIfEmpty();
qry.Dump();
此查询给出了预期的结果,但我还需要表中的一STATUS
列POLICies
,当我删除评论//p.STATUS
或//grp.STATUS
得到以下错误时
无法执行文本选择:
“System.Collections.Generic.IEnumerable”不包含“STATUS”的定义,并且找不到接受“System.Collections.Generic.IEnumerable”类型的第一个参数的扩展方法“STATUS”(按 F4 添加使用指令或程序集参考)
如果有人可以请帮助我解决这个问题,因为我已经尽我所能。
谢谢