gpt4 book ai didi

c# - EF lambda : The Include path expression must refer to a navigation property

转载 作者:可可西里 更新时间:2023-11-01 09:02:05 28 4
gpt4 key购买 nike

<分区>

这是我的表达:

Course course = db.Courses
.Include(
i => i.Modules.Where(m => m.IsDeleted == false)
.Select(s => s.Chapters.Where(c => c.IsDeleted == false))
).Include(i => i.Lab).Single(x => x.Id == id);

我知道原因是模块部分的Where(m => m.IsDeleted == false),但为什么会导致错误?更重要的是,我该如何修复它?

如果我删除 where 子句它工作正常但我想过滤掉已删除的模块。

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com