Bsft.Localization.EFCore
2.1.0
See the version list below for details.
dotnet add package Bsft.Localization.EFCore --version 2.1.0
NuGet\Install-Package Bsft.Localization.EFCore -Version 2.1.0
<PackageReference Include="Bsft.Localization.EFCore" Version="2.1.0" />
<PackageVersion Include="Bsft.Localization.EFCore" Version="2.1.0" />
<PackageReference Include="Bsft.Localization.EFCore" />
paket add Bsft.Localization.EFCore --version 2.1.0
#r "nuget: Bsft.Localization.EFCore, 2.1.0"
#:package Bsft.Localization.EFCore@2.1.0
#addin nuget:?package=Bsft.Localization.EFCore&version=2.1.0
#tool nuget:?package=Bsft.Localization.EFCore&version=2.1.0
Bsft.Localization.EFCore
EF Core persistence for the Bsft.Localization family: the translations table behind
ITranslationDbContext, its mapping, the reader the resolution chain reads through, and the seed
applier that writes a module's compiled-in defaults into the database.
Install
dotnet add package Bsft.Localization.EFCore
Requires Bsft.Localization (pulled transitively) and Microsoft.EntityFrameworkCore.
Register
services.AddBsftLocalizationEFCore<AppDbContext>();
AppDbContext implements ITranslationDbContext, and its OnModelCreating applies
TranslationEntityConfiguration. Without that configuration the entity still maps by convention but
the unique index over key, locale and tenant is silently absent — and that index is the only thing
stopping one tenant from holding two overrides of one key, which the chain would then pick between by
whatever order the provider happened to return. The configuration adds a second, non-unique index
over locale and tenant, which is what the whole-locale read behind a bundle seeks on — that read names
no key, so the unique index cannot answer it. This repository ships no migrations, so generate one
against your own context.
Seed data reaches the database through an extension on the context, typically at startup:
await dbContext.ApplyAsync(seed, ct);
It inserts what is missing and never overwrites what is there, always as a global row
(TenantId null), so a tenant's override survives a redeploy. It reads what the store holds once
rather than asking per entry, counts a stored row as the seed's row whatever the spelling of its
locale or key, and answers the unique index refusing a row a second instance inserted first by
inserting what is still missing — once.
Configure
None. The package has no options type and no configuration section: what it registers is decided by
the context type, which is a compile-time choice. Every tunable of the family — the locales, the
route prefix, the filter ceilings — belongs to BsftLocalizationOptions in Bsft.Localization.
| Option | Default | Effect |
|---|---|---|
| None. |
Validation: none of its own.
Extend
ITranslationDbContext is the seam onto the application's own context. ITranslationReader (declared
in Bsft.Localization) is registered here with TryAdd, so a host that registered its own reader
keeps it and this package contributes only the context binding.
Documentation
Topic page: docs/localization.md. Conventions: docs/package-conventions.md.
| 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 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
- Bsft.Localization (>= 2.1.0)
- Microsoft.EntityFrameworkCore (>= 9.0.19)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
-
net8.0
- Bsft.Localization (>= 2.1.0)
- Microsoft.EntityFrameworkCore (>= 9.0.19)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 9.0.19)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.