执行以下查询时出现错误
错误: 指定的 LINQ 表达式包含对与不同上下文关联的查询的引用
询问:
var wordlePuzzle = (from wp in wordlepostitionRepository.All
join wtc in wordletextclueRepository.All on wp.WordleTexCluetId equals wtc.WordleTextClueId
join w in wordleRepository.All on wtc.WordleId equals w.WordleId
where wtc.WordleId == id
select new WordlePuzzle
{
Row = w.WordleRow,
Column = w.WordleColumn,
Title = w.WordleTitle,
DifficultyLevel = DifficultyLevel.Easy,
Duration = w.WordleDuration,
ExpiresOn = w.ExpireDate
});
我试过.AsEnumerable();
在查询结束后追加,但它仍然给出错误。
对于所有这些表,我只有一个数据库。