这是我的声明
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.IQueryable
1[[<>f__AnonymousType0
2[[Data.Rad.EntityClasses.AxsEntity, Data.Rad, Version=1.0.4125.30654, Culture=neutral, PublicKeyToken=null],[Data.Rad.EntityClasses.AccountEntity, Data.Rad , Version=1.0.4125.30654, Culture=neutral, PublicKeyToken=null]], Model.Rad, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]]' 不能以任何方式转换为实体类型。您是否在 group by 子句中使用了 let 语句?
有没有办法做到这一点。如果我在内存中分组,它会杀死我的计算机。