Franz.Common.Http.EntityFramework
3.0.0
dotnet add package Franz.Common.Http.EntityFramework --version 3.0.0
NuGet\Install-Package Franz.Common.Http.EntityFramework -Version 3.0.0
<PackageReference Include="Franz.Common.Http.EntityFramework" Version="3.0.0" />
<PackageVersion Include="Franz.Common.Http.EntityFramework" Version="3.0.0" />
<PackageReference Include="Franz.Common.Http.EntityFramework" />
paket add Franz.Common.Http.EntityFramework --version 3.0.0
#r "nuget: Franz.Common.Http.EntityFramework, 3.0.0"
#:package Franz.Common.Http.EntityFramework@3.0.0
#addin nuget:?package=Franz.Common.Http.EntityFramework&version=3.0.0
#tool nuget:?package=Franz.Common.Http.EntityFramework&version=3.0.0
Franz.Common.Http.EntityFramework
ASP.NET Core integration for relational EF Core contexts and separate MongoDB/Cosmos context registration.
Overview
ASP.NET Core integration for relational EF Core contexts and separate MongoDB/Cosmos context registration.
Installation
dotnet add package Franz.Common.Http.EntityFramework
Relational database registration
Use AddRelationalDatabase<TDbContext>(IHostEnvironment, IConfiguration) for a context derived from DbContextBase.
using Franz.Common.Http.EntityFramework.Extensions;
builder.Services.AddRelationalDatabase<AppDbContext>(
builder.Environment,
builder.Configuration);
The method reads Database:Provider and supports mariadb, postgres, sqlserver, and oracle. Missing or unsupported provider values throw. Provider-specific registration is delegated to the corresponding Franz provider package.
After registering the relational provider, the method adds:
TransactionFilteras a scoped service and as an MVC service filter.- Generic entity repositories for the context.
- The package's EF behaviors.
The transaction filter does not begin a transaction. After the MVC action executes, it checks whether DbContext.Database.CurrentTransaction already exists; it commits that transaction when the action completed without an exception and rolls it back when an exception is present. The transaction must therefore be created by the surrounding persistence/application workflow.
MongoDB registration
Use AddMongoDatabase<TMongoContext>(IConfiguration) for a type derived from MongoDbContext.
builder.Services.AddMongoDatabase<AppMongoContext>(builder.Configuration);
The method requires Database:Provider to equal mongo (case-insensitive). It delegates to AddMongoDbContext<TMongoContext>.
Cosmos DB registration
Use AddCosmosDatabase<TCosmosContext>(IConfiguration) for a type derived from CosmosDbContextBase.
builder.Services.AddCosmosDatabase<AppCosmosContext>(builder.Configuration);
The method requires Database:Provider to equal cosmos (case-insensitive) and delegates to AddFranzCosmosDbContext<TCosmosContext>.
Provider boundaries
These are three distinct registration paths. MongoDB and Cosmos registration do not flow through the relational transaction-filter/repository/behavior registration path. Do not use the old single AddDatabase<TDbContext> sample from this guide's history.
Oracle registration remains present in the current switch despite the historical dependency note describing deprecation. Verify provider compatibility and the repository's current dependency validation before selecting it in a production deployment.
Operational guidance
Keep connection strings in environment-specific configuration or a secret provider. Validate provider/context alignment during startup and exercise the actual database provider in integration tests. Do not assume an MVC action filter provides a transaction when no current transaction exists.
License
MIT. See LICENSE.
| 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
- Franz.Common.AzureCosmosDB (>= 3.0.0)
- Franz.Common.DependencyInjection (>= 3.0.0)
- Franz.Common.EntityFramework.MariaDB (>= 3.0.0)
- Franz.Common.EntityFramework.Oracle (>= 3.0.0)
- Franz.Common.EntityFramework.PostGres (>= 3.0.0)
- Franz.Common.EntityFramework.SQLServer (>= 3.0.0)
- Franz.Common.MongoDB (>= 3.0.0)
- Microsoft.EntityFrameworkCore (>= 10.0.14)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.14)
- System.Security.Cryptography.Pkcs (>= 10.0.13)
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 |
|---|---|---|
| 3.0.0 | 91 | 11/10/2026 |
| 2.3.4 | 345 | 11/1/2026 |
| 2.3.3 | 309 | 10/28/2026 |
| 2.3.2 | 105 | 10/27/2026 |
| 2.3.1 | 157 | 10/26/2026 |
| 2.3.0 | 223 | 7/21/2026 |
| 2.2.19 | 133 | 7/19/2026 |
| 2.2.18 | 127 | 7/19/2026 |
| 2.2.17 | 652 | 7/12/2026 |
| 2.2.16 | 143 | 7/2/2026 |
| 2.2.15 | 140 | 6/29/2026 |
| 2.2.14 | 129 | 6/29/2026 |
| 2.2.13 | 136 | 6/29/2026 |
| 2.2.12 | 126 | 6/28/2026 |
| 2.2.11 | 127 | 6/28/2026 |
| 2.2.10 | 134 | 6/28/2026 |
| 2.2.9 | 128 | 6/28/2026 |
| 2.2.8 | 129 | 6/28/2026 |
| 2.2.7 | 132 | 6/7/2026 |
| 2.2.6 | 144 | 6/6/2026 |