Entity Framework Include Optimized Discover who supports this feature
Introduction
IncludeOptimized allows you to optimize the query generated by EF by executing multiple smaller queries instead of executing only one monster SQL.
Why IncludeOptimized?
Common Scenarios:
- The SQL generated by Entity Framework is too big and takes several seconds or minutes to execute.
Google Related Searches
// SELECT * FROM Order WHERE.... // SELECT * FROM OrderItem WHERE EXISTS (/* previous query */) AND ... // SELECT * FROM DeliveryItems WHERE EXISTS (/* previous query */) AND ... var orders = ctx.Orders .Where(x => x.OrderId == myOrderID) // 1 orders, 20 columns .IncludeOptimized(x => x.Items) // 20 items, 10 columns .IncludeOptimized(x => x.DeliveredItems) // 10 items, 10 columns .ToList();
Supported Libraries
Library | Type | EF Version | Support | Doc | Features |
---|---|---|---|---|---|
Z.EntityFramework.Plus | FREE | EF5 EF6 EF Core |
< 1 Day | Yes | Audit Batch Delete Batch Update Cache Deferred Query Filter Future Include Filter Include Optimized |
Unsupported Libraries
Use this library at your risk!
Library | Type | EF Version | Support | Doc | Features |
---|---|---|---|---|---|
EFUtilities | FREE | EF5 EF6 |
No | No | Bulk Insert Batch Delete Batch Update Include Optimized |
ZZZ Projects