CursedQueryable.EntityFrameworkCore
8.0.0
dotnet add package CursedQueryable.EntityFrameworkCore --version 8.0.0
NuGet\Install-Package CursedQueryable.EntityFrameworkCore -Version 8.0.0
<PackageReference Include="CursedQueryable.EntityFrameworkCore" Version="8.0.0" />
paket add CursedQueryable.EntityFrameworkCore --version 8.0.0
#r "nuget: CursedQueryable.EntityFrameworkCore, 8.0.0"
// Install CursedQueryable.EntityFrameworkCore as a Cake Addin #addin nuget:?package=CursedQueryable.EntityFrameworkCore&version=8.0.0 // Install CursedQueryable.EntityFrameworkCore as a Cake Tool #tool nuget:?package=CursedQueryable.EntityFrameworkCore&version=8.0.0
What is CursedQueryable.EntityFrameworkCore?
CursedQueryable is a library that aims to implement cursor-based keyset pagination (aka seek pagination) for IQueryable
with as close to zero boilerplate code as possible. This is achieved via examining the underlying expression tree for
any IQueryable
instance and rewriting it as needed prior to any database calls being made.
This repository contains the implementation for using CursedQueryable with Entity Framework Core, and is the primary
expected use case for CursedQueryable. If you're wanting to integrate with a different IQueryable
provider than
EFCore, you should grab the core library from the CursedQueryable repository instead.
Compatability
CursedQueryable.EntityFrameworkCore is compatible with Entity Framework Core versions 5 and above, and should work with any provider that plugs into it. It has been verified as working against the following specific providers:
Provider | Databases | Notes |
---|---|---|
Pomelo.EntityFrameworkCore.MySql | MariaDB, MySQL | |
MySql.EntityFrameworkCore | MySql | <small><span style="color:#FC0">⚠</span> EFCore 5 only: primary key(s) and ordering columns cannot be of type System.Guid .</small> |
Oracle.EntityFrameworkCore | Oracle | <small>Ensure NullBehaviour.LargerThanNonNullable is set.</small> |
Npgsql.EntityFrameworkCore.PostgreSQL | Postgres | <small>Ensure NullBehaviour.LargerThanNonNullable is set.</small> |
Microsoft.EntityFrameworkCore.SqlServer | SQL Server |
Getting started
Reference the CursedQueryable.EntityFrameworkCore
package, make sure it's configured correctly, then
just call the CursedQueryable extension methods .ToPage()
/.ToPageAsync()
instead of .ToList()
/.ToListAsync()
:
using CursedQueryable.Extensions;
public async Task<Page<Cat>> GetPageOfCats(string? cursor)
{
return await dbContext
.Cats
.Take(10)
.ToPageAsync(cursor);
}
// This will get an initial page of (up to) 10 cats
var pageOfCats = await GetPageOfCats(null);
Additional documentation is available in the CursedQueryable repository.
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. |
-
net8.0
- CursedQueryable (>= 1.0.0)
- Microsoft.EntityFrameworkCore (>= 8.0.5)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.