CursedQueryable.EntityFrameworkCore 8.0.0

dotnet add package CursedQueryable.EntityFrameworkCore --version 8.0.0                
NuGet\Install-Package CursedQueryable.EntityFrameworkCore -Version 8.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="CursedQueryable.EntityFrameworkCore" Version="8.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add CursedQueryable.EntityFrameworkCore --version 8.0.0                
#r "nuget: CursedQueryable.EntityFrameworkCore, 8.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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                

CI badge NuGet License

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
8.0.0 129 5/17/2024
7.0.0 115 5/17/2024
6.0.0 109 5/17/2024
5.0.0 109 5/17/2024