Bsft.Localization.EFCore 2.2.0

dotnet add package Bsft.Localization.EFCore --version 2.2.0
                    
NuGet\Install-Package Bsft.Localization.EFCore -Version 2.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="Bsft.Localization.EFCore" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Bsft.Localization.EFCore" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Bsft.Localization.EFCore" />
                    
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 Bsft.Localization.EFCore --version 2.2.0
                    
#r "nuget: Bsft.Localization.EFCore, 2.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 Bsft.Localization.EFCore@2.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=Bsft.Localization.EFCore&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Bsft.Localization.EFCore&version=2.2.0
                    
Install as a Cake Tool

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 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. 
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
2.2.0 73 10/23/2026
2.1.0 113 9/28/2026