Toamaisutaa.EntityFrameworkCore
0.5.0
dotnet add package Toamaisutaa.EntityFrameworkCore --version 0.5.0
NuGet\Install-Package Toamaisutaa.EntityFrameworkCore -Version 0.5.0
<PackageReference Include="Toamaisutaa.EntityFrameworkCore" Version="0.5.0" />
<PackageVersion Include="Toamaisutaa.EntityFrameworkCore" Version="0.5.0" />
<PackageReference Include="Toamaisutaa.EntityFrameworkCore" />
paket add Toamaisutaa.EntityFrameworkCore --version 0.5.0
#r "nuget: Toamaisutaa.EntityFrameworkCore, 0.5.0"
#:package Toamaisutaa.EntityFrameworkCore@0.5.0
#addin nuget:?package=Toamaisutaa.EntityFrameworkCore&version=0.5.0
#tool nuget:?package=Toamaisutaa.EntityFrameworkCore&version=0.5.0
Toamaisutaa.EntityFrameworkCore
Entity Framework Core storage for Toamaisutaa: users, external logins, password credentials, refresh tokens, reset tokens, and two-factor enrolments.
There are two ways to use it, and they differ only in whose DbContext holds the tables.
Its own context, so the tables live apart from yours:
builder.Services.AddToamaisutaaDbContext(db => db.UseNpgsql(
connectionString,
npgsql => npgsql.MigrationsAssembly("Toamaisutaa.EntityFrameworkCore.Migrations.Postgres")));
Your context, so they do not:
protected override void OnModelCreating(ModelBuilder modelBuilder) =>
modelBuilder.ApplyToamaisutaaConfiguration();
builder.Services.AddToamaisutaaEntityFrameworkStores<YourDbContext>();
The shipped migrations only cover ToamaisutaaDbContext, so with your own context you generate the
migration in your own project. Every entity configuration is public, and calling ToTable after one
renames its table.
Migrations
Install one alongside this package - they are provider-specific and cannot share an assembly:
| Provider | Package |
|---|---|
| PostgreSQL | Toamaisutaa.EntityFrameworkCore.Migrations.Postgres |
| SQLite | Toamaisutaa.EntityFrameworkCore.Migrations.Sqlite |
| SQL Server | Toamaisutaa.EntityFrameworkCore.Migrations.SqlServer |
| MySQL | Toamaisutaa.EntityFrameworkCore.Migrations.MySql |
One thing worth knowing
Every timestamp is stored as Unix milliseconds in a long, not as a native date type. SQLite
cannot translate a range query on a DateTimeOffset, and the cleanup sweep is exactly that query, so
the column type is chosen by the provider that cannot do it rather than the ones that can. The
conversion is transparent - the entities expose DateTimeOffset - but it is visible if you query the
tables by hand.
Documentation
Storage and migrations - docs.toamaisutaa.pianonic.ch
Licensed under PolyForm Noncommercial 1.0.0 - free for noncommercial use; commercial use needs a separate licence.
| Product | Versions 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. |
-
net10.0
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.10)
- Toamaisutaa.Core (>= 0.5.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Toamaisutaa.EntityFrameworkCore:
| Package | Downloads |
|---|---|
|
Toamaisutaa.EntityFrameworkCore.Migrations.Postgres
PostgreSQL migrations for the Toamaisutaa schema. Migrations are provider-specific and cannot share an assembly, so each provider ships its own. |
|
|
Toamaisutaa.EntityFrameworkCore.Migrations.Sqlite
SQLite migrations for the Toamaisutaa schema. Migrations are provider-specific and cannot share an assembly, so each provider ships its own. |
|
|
Toamaisutaa.EntityFrameworkCore.Migrations.MySql
MySQL migrations for the Toamaisutaa schema. Migrations are provider-specific and cannot share an assembly, so each provider ships its own. |
|
|
Toamaisutaa.EntityFrameworkCore.Migrations.SqlServer
SQL Server migrations for the Toamaisutaa schema. Migrations are provider-specific and cannot share an assembly, so each provider ships its own. |
GitHub repositories
This package is not used by any popular GitHub repositories.