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
                    
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="Franz.Common.Http.EntityFramework" Version="3.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Http.EntityFramework" Version="3.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Franz.Common.Http.EntityFramework" />
                    
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 Franz.Common.Http.EntityFramework --version 3.0.0
                    
#r "nuget: Franz.Common.Http.EntityFramework, 3.0.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 Franz.Common.Http.EntityFramework@3.0.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=Franz.Common.Http.EntityFramework&version=3.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Http.EntityFramework&version=3.0.0
                    
Install as a Cake Tool

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:

  • TransactionFilter as 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 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. 
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
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
Loading failed