EntityFrameworkCore.KingbaseES icon indicating copy to clipboard operation
EntityFrameworkCore.KingbaseES copied to clipboard

以下错误是我在 DotNetCore.EntityFrameworkCore.KingbaseES Version="6.0.22" 查询时报的错误 该如何解决

Open XxyGitHub opened this issue 1 year ago • 5 comments
trafficstars

The LINQ expression 'DbSet<Trainee>() .GroupJoin( inner: DbSet<TrainRecord>() .Where(v => v.EndDate < __now_0 || v.EndDate == null && (int?)v.OrgAuditState == (int?)已通过), outerKeySelector: user => (Guid?)user.Id, innerKeySelector: record => record.TraineeId, resultSelector: (user, recordsMap) => new UserRecordDto{ Id = user.Id, CreatedOn = user.CreatedOn, Unionid = user.Unionid, OpenId = user.OpenId, Name = user.Name, Sex = user.Sex, Nation = user.Nation, Political = user.Political, Phone = user.Phone, DeptId = user.DeptId, DeptCode = user.DeptCode, PostRank = user.PostRank, UnManageRank = user.UnManageRank, Birthday = user.Birthday, WorkUnit = user.WorkUnit, Job = user.Job, Days = recordsMap .AsQueryable() .Sum(v => v.Days), DeductDays = recordsMap .AsQueryable() .Sum(v => v.DeductDays), ActualDays = recordsMap .AsQueryable() .Sum(v => v.ActualDays) } )' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.

XxyGitHub avatar May 21 '24 06:05 XxyGitHub