过滤包含在 EF Core 中 - Filtering on Include in EF Core

问题:

I'm trying to filter on the initial query.我正在尝试过滤初始查询。 I have nested include leafs off a model.我在模型上嵌套了包含叶子。 I'm trying to filter based on a property on one of the includes.我正在尝试根据其中一个包含的属性进行过滤。 For example:例如:

using (var context = new BloggingContext())
{
    var blogs = context.Blogs
        .Include(blog => blog.Posts)
            .ThenInclude(post => post.Author)
        .ToList();
}

How can I also say .Where(w => w.post.Author == "me") ?我怎么还能说.Where(w => w.post.Author == "me")


解决方案:

参考: https://stackoom.com/en/question/2x13g
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章