提问人:Herman 提问时间:11/12/2023 更新时间:11/12/2023 访问量:33
EntityFramework Include ThenInclude 多个超慢 [duplicate]
EntityFramework Include ThenInclude Multiple Super Slow [duplicate]
问:
我有以下代码,其中包含多个.Include 和 .然后包含。
var query = _postUserRepository.TableNoTracking;
query = query.Where(x => x.User.Name.Contains(name));
query = query.Where(x => x.User.Email.Contains(email));
query = query.Where(x => x.JobPostId == jobPostId);
query = query.Where(x => x.JobPost.ExpiresAt > expiredDate);
query = query.Where(x => x.JobPost.UserId == userId);
query = query.Include(x => x.User)
.ThenInclude(y => y.Languages);
query = query.Include(x => x.User)
.ThenInclude(y => y.Skills);
query = query.Include(x => x.User)
.ThenInclude(y => y.Educations);
query = query.Include(x => x.User)
.ThenInclude(y => y.Resumes;
query = query.Include(x => x.User)
.ThenInclude(y => y.Talent);
var list = query.Take(20).ToList()
我认为问题是因为多个.然后包含。
如何解决该问题?
答: 暂无答案
评论
Contains
Include(x=>x.User)
AsSplitQuery()