Craticula.EntityFrameworkCore 1.2.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Craticula.EntityFrameworkCore --version 1.2.0
                    
NuGet\Install-Package Craticula.EntityFrameworkCore -Version 1.2.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="Craticula.EntityFrameworkCore" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Craticula.EntityFrameworkCore" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Craticula.EntityFrameworkCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Craticula.EntityFrameworkCore --version 1.2.0
                    
#r "nuget: Craticula.EntityFrameworkCore, 1.2.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.
#:package Craticula.EntityFrameworkCore@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Craticula.EntityFrameworkCore&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Craticula.EntityFrameworkCore&version=1.2.0
                    
Install as a Cake Tool

Craticula.EntityFrameworkCore

The Entity Framework Core execution adapter of Craticula. It compiles the canonical IR straight to IQueryable<T> expression trees and runs them, so no SQL text is produced here. It works with any relational provider (you choose the provider package) and supports paging, row counts and streamed export.

Install

dotnet add package Craticula.EntityFrameworkCore

Depends on Microsoft.EntityFrameworkCore.Relational [10.0.12, 11.0).

Example

using Craticula.Core.Ir;
using Craticula.Core.Schema;
using Craticula.EntityFrameworkCore;

public static class Example
{
    public static async Task<EfCoreGridPage> Fetch<TRow>(
        IQueryable<TRow> source, GridSchema schema, FilterNode? filter, IReadOnlyList<SortItem>? sort, PageSpec page)
        where TRow : class
    {
        var request = new EfCoreQueryRequest { Schema = schema, Filter = filter, Sort = sort, Page = page };

        // EfCoreProviderSemantics.Sqlite is the one measured preset; declare your own for other engines.
        return await EfCoreGridQuery.FetchPageAsync(
            source, request, EfCoreProviderSemantics.Sqlite, includeRowCount: true);
    }
}

Two host obligations that fail silently

Both run without error and return wrong rows, so the adapter documents them; it cannot see the host's model or collations.

  • SQLite instants. Store a datetime as yyyy-MM-ddTHH:mm:ss.fffZ text (SEM-4) and map every DateTime to and from that text in your DbContext (configurationBuilder.Properties<DateTime>().HaveConversion<YourStoredInstantConverter>()). EF's own mapping binds a value as yyyy-MM-dd HH:mm:ss; on the value's own date 'T' sorts after a space. Without the mapping an eq at a stored time finds nothing, a neq finds every row, a range bound counts the whole bound date as later (13,335 rows for 13,321 on the demo), and a datetime-sorted export repeats or drops rows at chunk edges (20,060 and 19,947 rows for 20,000). An export whose walk meets the row the previous chunk ended on stops with an exception rather than loop. The mapping writes millisecond text, so a finer-than-millisecond bound is truncated, not floored or ceiled as the SQL compiler does (SEM-4).
  • PatternMatchFoldsCase says what the engine's LIKE does. SQLite: true (its LIKE folds ASCII case whatever the column is, and true is what makes a caseSensitivity: "sensitive" field refuse instead of answering case-insensitively). SQL Server and MySQL: false, unless every searchable column's collation folds case, because true sends a bare LIKE that follows the column's collation and a binary-collated column (..._BIN2, utf8mb4_bin) then matches exact case only: contains "germ" finds no Germany. false lowers both sides and is right for every case-insensitive field.

EfCoreHostObligationTests shows each: wrong rows without it, right rows with it.

Datetime cells

A datetime cell leaves a page or an export row as a UTC instant, whatever kind the provider materialised (SEM-4, result side): a UTC value is kept, a local one is converted, a zone-less one (SQL Server datetime2, MySQL DATETIME, SQLite text) is read as UTC. A host needs no UTC value converter for the way out. The values it stores must still be UTC readings.

Compatibility

Implements Craticula spec version 0.2.0 (the language-neutral semantics and conformance fixtures in the repository, spec/). Targets .NET 10.

License

Apache-2.0. Source and issues: https://github.com/pluries/craticula.

Product Compatible and additional computed target framework versions.
.NET 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. 
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
1.3.0 61 11/26/2026
1.2.1 101 11/15/2026
1.2.0 143 11/12/2026
1.1.0 97 11/12/2026
1.0.0 102 11/10/2026