QuickPersistr.EntityFrameworkCore
0.0.2
dotnet add package QuickPersistr.EntityFrameworkCore --version 0.0.2
NuGet\Install-Package QuickPersistr.EntityFrameworkCore -Version 0.0.2
<PackageReference Include="QuickPersistr.EntityFrameworkCore" Version="0.0.2" />
<PackageVersion Include="QuickPersistr.EntityFrameworkCore" Version="0.0.2" />
<PackageReference Include="QuickPersistr.EntityFrameworkCore" />
paket add QuickPersistr.EntityFrameworkCore --version 0.0.2
#r "nuget: QuickPersistr.EntityFrameworkCore, 0.0.2"
#:package QuickPersistr.EntityFrameworkCore@0.0.2
#addin nuget:?package=QuickPersistr.EntityFrameworkCore&version=0.0.2
#tool nuget:?package=QuickPersistr.EntityFrameworkCore&version=0.0.2
QuickPersistr.EntityFrameworkCore
The provider-neutral Entity Framework Core adapter for QuickPersistr.
Use this package when your test environment already creates and owns the database. For a ready-made isolated database, use the SQLite or PostgreSQL provider package instead.
dotnet add package QuickPersistr.EntityFrameworkCore --version 0.0.1
Usage
Configure your EF provider normally and pass a context factory:
using Microsoft.EntityFrameworkCore;
using QuickPersistr;
using QuickPersistr.EntityFrameworkCore;
var options = new DbContextOptionsBuilder<LibraryDbContext>()
.UseYourProvider(testDatabaseConnectionString)
.Options;
Persistr.Named("Books")
.Scope(() => new EfPersistenceScope<LibraryDbContext>(
() => new LibraryDbContext(options)))
.Entities(new BookPersistence())
.Run();
UseYourProvider represents the configuration extension supplied by the provider you choose.
Database lifecycle
The scope:
- creates and disposes every
DbContext; - calls
Database.EnsureCreated()by default; - creates fresh contexts for
StartNewSession(); - creates independent contexts for optimistic-concurrency scenarios.
The context factory must always connect to the same isolated test database for the lifetime of the scope. The scope does not own external connections, containers, servers, or database cleanup. Pass ensureCreated: false when schema creation is handled by migrations or test infrastructure.
This package supports EF Core 8.x and targets .NET 8. QuickPersistr is an early preview. APIs may change before version 1.0.
| 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 was computed. 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. |
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.29 && < 9.0.0)
- QuickPersistr (>= 0.0.2)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on QuickPersistr.EntityFrameworkCore:
| Package | Downloads |
|---|---|
|
QuickPersistr.EntityFrameworkCore.Sqlite
Isolated in-memory SQLite persistence scope for QuickPersistr and Entity Framework Core. |
|
|
QuickPersistr.EntityFrameworkCore.PostgreSql
Isolated temporary PostgreSQL database scope for QuickPersistr and Entity Framework Core. |
GitHub repositories
This package is not used by any popular GitHub repositories.