在linq中按llblgen分组
|
这是我的陈述
private IEnumerable<IGrouping<AccountEntity,AxsEntity>> GetAxsEntitiesForInvoicing(IDataAccessAdapter adapter)
{
var metaData = new LinqMetaData(adapter);
var query = from axsEntity in metaData.Axs
join accountEntity in metaData.Account on axsEntity.AccountId equals accountEntity.AccountId
where
(axsEntity.DateDeleted.HasValue? axsEntity.DateDeleted.Value<DateTime.Now:true) &&
(axsEntity.DateEnd == null || axsEntity.DateEnd > axsEntity.DateRenewal) &&
axsEntity.DateRenewal < RenewalDate // NONE INCLUSIVE DATE
group axsEntity by accountEntity into axsCol
select axsCol;
return query;
一旦我尝试将其转换为.ToList(),它将引发错误。
类型\'System.Linq.IQueryable1[[<>f__AnonymousType0
2[[Data.Rad.EntityClasses.AxsEntity,Data.Rad,Version = 1.0.4125.30654,Culture = neutral,PublicKeyToken = null],[Data.Rad.EntityClasses.AccountEntity,Data.Rad ,版本= 1.0.4125.30654,文化=中性,PublicKeyToken = null]],模型.Rad,版本= 1.0.0.0,文化=中性,PublicKeyToken = null]]''不能在任何情况下转换为实体类型道路。您是否在group by子句上使用了let语句?
反正有做到这一点。如果我按内存分组,它将杀死我的计算机。
没有找到相关结果
已邀请:
1 个回复
哭木算