Affiant.EntityFramework 1.0.0-beta.1

Prefix Reserved
This is a prerelease version of Affiant.EntityFramework.
dotnet add package Affiant.EntityFramework --version 1.0.0-beta.1
                    
NuGet\Install-Package Affiant.EntityFramework -Version 1.0.0-beta.1
                    
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="Affiant.EntityFramework" Version="1.0.0-beta.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Affiant.EntityFramework" Version="1.0.0-beta.1" />
                    
Directory.Packages.props
<PackageReference Include="Affiant.EntityFramework" />
                    
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 Affiant.EntityFramework --version 1.0.0-beta.1
                    
#r "nuget: Affiant.EntityFramework, 1.0.0-beta.1"
                    
#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 Affiant.EntityFramework@1.0.0-beta.1
                    
#: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=Affiant.EntityFramework&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Affiant.EntityFramework&version=1.0.0-beta.1&prerelease
                    
Install as a Cake Tool

Affiant.EntityFramework

EntityFramework Core persistence adapter for the Affiant framework — "sworn provenance for every AI write."

Provides the shared AffiantDbContext (chat sessions, conversation context, docket entries — schema-isolated so it can coexist with a host's own DbContext), the SQLite and PostgreSQL IChatSessionStore and IDocketStore implementations, an in-memory IChatSessionStore with no EF dependency at all, and the EF Core migrations every SQL backend runs against.

Quick start

builder.Services.AddAffiantCore();
builder.Services.AddAffiantEntityFramework(ef =>
{
    ef.UsePostgres(connectionString); // or ef.UseSqlite(...) / ef.UseInMemory()
});

At startup, apply pending migrations (SQLite and PostgreSQL only — UseInMemory() needs no schema):

await using var scope = app.Services.CreateAsyncScope();
var db = scope.ServiceProvider.GetRequiredService<AffiantDbContext>();
await AffiantMigrator.MigrateAffiantSchemaAsync(db);

The SQL-backed Docket lives here too (affiant#35)

ef.UsePostgres(...) / ef.UseSqlite(...) register both IChatSessionStore and IDocketStore for that provider. SqliteDocketStore/PostgresDocketStore moved into this package in 1.0.0-beta.1: they take this package's AffiantDbContext and map its DocketEntryEntity through migrations that always lived here, so keeping them in Affiant.Docket forced that package to depend on this one — an adapter-to-adapter dependency the framework's layering invariant forbids, and one that dragged EF Core plus both database drivers onto every Affiant.Docket consumer.

A SQL-backed host therefore wires:

builder.Services.AddAffiantEntityFramework(ef => ef.UseSqlite(connectionString)); // IChatSessionStore + IDocketStore
builder.Services.AddAffiantDocket();                                              // DocketExpiryService (backend-neutral)

ef.UseInMemory() registers no IDocketStore — the in-memory implementation is Affiant.Docket's InMemoryDocketStore, selected with AddAffiantDocket(d => d.UseInMemory()).

Package contents

Namespace Purpose
(root) AffiantDbContext, AffiantDbContextFactory (design-time factory for dotnet ef)
Affiant.EntityFramework.Stores IChatSessionStore implementations — InMemoryChatSessionStore, SqliteChatSessionStore, PostgresChatSessionStore — and the SQL-backed IDocketStore implementations SqliteDocketStore, PostgresDocketStore
Affiant.EntityFramework.Models EF entity types — ChatSessionEntity, ChatMessageEntity, ConversationContextEntity, DocketEntryEntity
Affiant.EntityFramework.Configurations IEntityTypeConfiguration<T> implementations for each entity
Affiant.EntityFramework.Migrations Checked-in EF Core migrations plus AffiantMigrator — the schema-apply/heal entry point hosts call at startup
Affiant.EntityFramework.Extensions ServiceCollectionExtensionsAddAffiantEntityFramework

Further reading


Part of the Affiant Framework | Apache-2.0 License

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.0.0-beta.1 50 8/23/2026