ApiQueryOptions.EntityFrameworkCore
1.0.0-beta4
See the version list below for details.
dotnet add package ApiQueryOptions.EntityFrameworkCore --version 1.0.0-beta4
NuGet\Install-Package ApiQueryOptions.EntityFrameworkCore -Version 1.0.0-beta4
<PackageReference Include="ApiQueryOptions.EntityFrameworkCore" Version="1.0.0-beta4" />
<PackageVersion Include="ApiQueryOptions.EntityFrameworkCore" Version="1.0.0-beta4" />
<PackageReference Include="ApiQueryOptions.EntityFrameworkCore" />
paket add ApiQueryOptions.EntityFrameworkCore --version 1.0.0-beta4
#r "nuget: ApiQueryOptions.EntityFrameworkCore, 1.0.0-beta4"
#:package ApiQueryOptions.EntityFrameworkCore@1.0.0-beta4
#addin nuget:?package=ApiQueryOptions.EntityFrameworkCore&version=1.0.0-beta4&prerelease
#tool nuget:?package=ApiQueryOptions.EntityFrameworkCore&version=1.0.0-beta4&prerelease
ApiQueryOptions.EntityFrameworkCore
EF Core companion for ApiQueryOptions.
Translates $expand into .Include() calls and applies the full query pipeline (filter → orderby → skip → top → expand) as a single deferred SQL query. Nothing is enumerated until you call .ToListAsync().
Installation
dotnet add package ApiQueryOptions
dotnet add package ApiQueryOptions.EntityFrameworkCore
Quick start
1. Register in Program.cs
builder.Services.AddControllers();
builder.Services.AddApiQueryOptions();
2. Use the EF Core Apply extension
using ApiQueryOptions.EntityFrameworkCore.Extensions;
[HttpGet]
public async Task<IActionResult> Get(ApiQueryOptions<Order> options)
{
List<Order> items = await _db.Orders
.Apply(options) // filter + orderby + skip + top + expand
.AsNoTracking()
.ToListAsync();
return Ok(new { value = items, nextLink = options.NextLink(items.Count) });
}
3. Request with $expand
GET /api/orders?$filter=Status eq 'Open'&$orderby=CreatedAt desc&$top=20&$expand=Customer,Lines
EF Core eagerly loads the Customer navigation property and Lines collection as part of the same SQL query — no N+1 queries.
What this package adds
| Feature | ApiQueryOptions |
This package |
|---|---|---|
$filter → Where() |
✔ | ✔ |
$orderby → OrderBy() |
✔ | ✔ |
$top → Take() |
✔ | ✔ |
$skip → Skip() |
✔ | ✔ |
Cursor pagination (NextLink) |
✔ | ✔ |
$expand → .Include() |
✔ | |
Async .ToListAsync() support |
✔ |
EF Core extensions
using ApiQueryOptions.EntityFrameworkCore.Extensions;
// Full pipeline — filter → orderby → skip → top → expand:
IQueryable<T> result = query.Apply(options);
// Expand only:
IQueryable<T> result = query.ApplyExpand(options.Expand!, options.Settings);
The EF Core Apply runs the core pipeline first, then appends .Include() calls for each path listed in $expand. The whole chain is deferred and translates to a single SQL round-trip.
Nested expand paths
Dot-delimited paths are supported for deep includes:
$expand=Customer,Lines.Product
This generates:
.Include(o => o.Customer)
.Include(o => o.Lines).ThenInclude(l => l.Product)
Supported frameworks
| Framework | EF Core version |
|---|---|
net8.0 |
8.0.x |
net10.0 |
10.0.x |
Source & documentation
Full documentation, runnable examples, and source: github.com/MassiveScale/ApiQueryOptions
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- ApiQueryOptions (>= 1.0.0-beta4)
- Microsoft.EntityFrameworkCore (>= 10.0.9)
-
net8.0
- ApiQueryOptions (>= 1.0.0-beta4)
- Microsoft.EntityFrameworkCore (>= 8.0.28)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0-beta5 | 931 | 6/14/2026 |
| 1.0.0-beta4 | 74 | 6/13/2026 |
| 1.0.0-beta3 | 73 | 6/12/2026 |
| 1.0.0-beta2 | 68 | 6/10/2026 |
| 1.0.0-beta1 | 69 | 6/10/2026 |