過濾包含在 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章