IEnumerable<Game> games = await _context.Games
.Include(e => e.Challenger)
.Include(e => e.Opponent)
.Include(e => e.Winner)
.ToListAsync();
當我在 .Net Core App 中使用 Entity Framework 6 查詢表時,我從資料庫中獲得了一個包含正確元素的串列,到目前為止一切看起來都很好:

然后在第二個螢屏截圖中,您可以看到它已按完成值過濾,等于“false”

嘗試像這樣運行查詢
games = games.Where(g => g.Finished == true); //or .Where(g => g.Finished)
你可能會看到不同的結果。希望這會有所幫助
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/497411.html
標籤:C# 林克 .net-core 实体框架核心 where子句
下一篇:使用自定義FUNC過濾串列
