Web在 EF Core 2.2 中,這需要不到幾秒鍾的時間來評估。 現在在 EF Core 3.0 上,大約需要 15 秒才能完成。 EF Core 3 是怎么回事? 我在這里讀到 ef 現在為每個 linq 查詢創建一個 sql 語句,但我看不出該語句在這種情況下會如何變化。 WebJun 27, 2024 · ThenInclude You can drill down through relationships to include multiple levels of related data using the ThenInclude method. The following example retrieves data from Users, UserRoles, and Roles tables. using (var context = new UserContext()) { var User = context.Users .Include(ur=> ur.UserRoles) .ThenInclude(r => r.Roles) .ToList(); }
c# - EF Core 3.0.Include() 鏈比 2.2 長約 5-10 倍 - 堆棧內存溢出
WebFeb 23, 2024 · EF Core has a new extension method ThenInclude(). You can drill down thru relationships to include multiple levels of related data using the ThenInclude method. … http://duoduokou.com/csharp/27342138329645772088.html pool table diamond locations
Entity Framework Core Include(...Where) - CodeRoad
WebEntity Framework Classic ThenInclude Description You can chain multiple related objects to the query result by using the AlsoInclude and ThenInclude methods. The ThenInclude … WebApr 12, 2024 · context.entities.Include(e=>e.SomeFkNavigation) it will return the entities with that navigation populated (all cols of the navigation) My question is if i do: context.entities.Include(e=>e.SomeFkNavigation).ThenInlude(fk=>fk.SomeProperty) Will that be faster since its only fetching one property? WebFrom EF Core docs... emphasis on the last sentence. You may want to include multiple related entities for one of the entities that is being included. For example, when querying Blogs, you include Posts and then want to include both the Author and Tags of the Posts. To do this, you need to specify each include path starting at the root. shared maternity leave entitlement