var packs = from r in new XPQuery<Roll>(session)
join p in new XPQuery<Pack>(session) on r.Pack equals p
group new { r, p } by new { r.Pack } into gb
select new
{
Length = gb.Sum(x => x.r.Length),
ALength = gb.Where(a => a.r.Grade == "A").Sum(x => x.r.Length),
};
gcPack.DataSource = packs;
我知道ALenght = gb.Where(a => a.r.Grade == "A").Sum(x => x.r.Lenght)
会导致运行时错误,如果没有它,代码就可以了。是否可以在这样的select语句中使用where。
错误:
其他信息:物业路径&#39; r&#39;类型&#39; DataRepository.Roll&#39;是不正确的因为会员&#39; DataRepository.Roll.r&#39;不存在。