Franz.Common.Http.EntityFramework 1.6.3

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

Franz.Common.Http.EntityFramework

A specialized library within the Franz Framework that integrates Entity Framework Core with ASP.NET Core applications. This package simplifies transactional handling, dependency injection, and middleware configurations, enhancing database operations in HTTP-based services.


Features

  • Transactional Filters:

    • TransactionFilter for managing database transactions seamlessly in API requests.
  • Service Registration:

    • ServiceCollectionExtensions for registering database contexts and transactional filters.
  • Entity Framework Core Integration:

    • Built-in support for relational database operations.
  • Multi-Database Provider Support (since 1.3.4, extended in 1.6.2 & 1.6.3):

    • Configure MariaDB, Postgres, Oracle, or SQL Server via appsettings.json.
    • Since 1.6.2 → Polyglot persistence: support for MongoDB and Azure Cosmos DB as first-class NoSQL providers.
    • New in 1.6.3 → Environment-aware multi-database registration with provider validation, preventing silent misconfigurations.
  • Modular Design:

    • Compatible with other Franz Framework persistence components, such as:

      • Franz.Common.EntityFramework.MariaDB
      • Franz.Common.EntityFramework.Postgres
      • Franz.Common.EntityFramework.Oracle
      • Franz.Common.EntityFramework.SQLServer
      • Franz.Common.MongoDB
      • Franz.Common.AzureCosmosDB

Version Information

  • Current Version: 1.6.3 → Adds environment-aware validation, stronger governance for multi-database setups, and provider-context alignment.
  • Part of the private Franz Framework ecosystem.

Dependencies

This package relies on:

  • Microsoft.EntityFrameworkCore (8.0.0)
  • Microsoft.EntityFrameworkCore.Relational (8.0.0)
  • Microsoft.AspNetCore.Mvc (2.2.0)
  • Franz.Common.DependencyInjection
  • Franz.Common.EntityFramework.MariaDB
  • Franz.Common.EntityFramework.Postgres
  • Franz.Common.EntityFramework.Oracle
  • Franz.Common.EntityFramework.SQLServer
  • Franz.Common.MongoDB (since 1.6.2)
  • Franz.Common.AzureCosmosDB (since 1.6.2)

Installation

From Private Azure Feed

dotnet nuget add source "https://your-private-feed-url" \
  --name "AzurePrivateFeed" \
  --username "YourAzureUsername" \
  --password "YourAzurePassword" \
  --store-password-in-clear-text

Install the package:

dotnet add package Franz.Common.Http.EntityFramework

Usage

1. Configure Provider in appsettings.json

{
  "Database": {
    "Provider": "Postgres",
    "ConnectionString": "Host=localhost;Database=mydb;Username=myuser;Password=mypass"
  },
  "MongoDb": {
    "Provider": "Mongo",
    "ConnectionString": "mongodb://localhost:27017",
    "DatabaseName": "FranzMongoDb"
  },
  "CosmosDb": {
    "Provider": "Cosmos",
    "ConnectionString": "AccountEndpoint=https://your-account.documents.azure.com:443/;AccountKey=your-key;",
    "DatabaseName": "FranzCosmosDb"
  }
}

Supported providers: MariaDb, Postgres, Oracle, SqlServer, Mongo, Cosmos.


2. Register Database Context

builder.Services.AddDatabase<MyDbContext>(builder.Environment, builder.Configuration);

For multiple contexts (polyglot persistence):

builder.Services.RegisterDatabaseForContext<MyRelationalDbContext>(builder.Configuration.GetSection("Database"));
builder.Services.RegisterDatabaseForContext<MyMongoDbContext>(builder.Configuration.GetSection("MongoDb"));
builder.Services.RegisterDatabaseForContext<MyCosmosStore>(builder.Configuration.GetSection("CosmosDb"));

3. Enable Transaction Filters

Automatically applied by default, but can be explicitly added:

using Franz.Common.Http.EntityFramework.Transactions;

services.AddControllers(options =>
{
    options.Filters.Add<TransactionFilter>();
});

Integration with Franz Framework

The Franz.Common.Http.EntityFramework package integrates seamlessly with:

  • Franz.Common.EntityFramework
  • Franz.Common.EntityFramework.MariaDB
  • Franz.Common.EntityFramework.Postgres
  • Franz.Common.EntityFramework.Oracle
  • Franz.Common.EntityFramework.SQLServer
  • Franz.Common.MongoDB
  • Franz.Common.AzureCosmosDB
  • Franz.Common.DependencyInjection

Changelog

Version 1.6.3

  • Environment-aware validation added to AddDatabase<TDbContext> and RegisterDatabaseForContext<TContext>:

    • Enforces correct provider/context alignment for relational (EF), MongoDB, and CosmosDB contexts.
    • Prevents silent misconfigurations (wrong provider/context combinations now throw explicit exceptions).
    • Guards against hardcoded connection strings — all values must come from appsettings.{Environment}.json.
  • Governance baked in for relational DBs:

    • Automatic registration of transactions per HTTP call, generic repositories, and behaviors.
  • Extended multi-database orchestration:

    • Support for mixing multiple contexts (MariaDB, Postgres, Oracle, SQLServer, MongoDB, CosmosDB) within the same app.
    • Polyglot persistence scenarios are now governed by clear, opinionated rules.

Version 1.6.2

  • Extended multi-database provider support to include NoSQL providers:

    • Added MongoDB support via Franz.Common.MongoDB.
    • Added Azure Cosmos DB support via Franz.Common.AzureCosmosDB.
  • AddDatabase<TDbContext> now supports both relational and document database providers via config.

  • Introduced CosmosDBMessageStore and MongoMessageStore to unify outbox & dead-letter messaging in NoSQL providers.

  • Full alignment with Franz polyglot persistence philosophy.

Version 1.3.4

  • Added multi-database provider support (MariaDB, Postgres, Oracle, SQL Server).
  • Provider selection now handled via appsettings.json (Database:Provider).
  • Simplified registration: AddDatabase<TDbContext>(env, config).

Version 1.3

  • Upgraded to .NET 9.0.8
  • Added new features and improvements
  • Separated business concepts from mediator concepts
  • Now compatible with both the in-house mediator and MediatR

Version 1.2.65

  • Upgraded version to .NET 9

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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 was computed.  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
1.6.3 107 10/9/2025
1.6.2 138 10/7/2025
1.5.9 165 9/24/2025
1.5.4 161 9/23/2025
1.5.3 208 9/21/2025
1.5.2 207 9/21/2025
1.5.0 203 9/21/2025
1.4.4 179 9/20/2025
1.3.14 289 9/18/2025
1.3.13 286 9/18/2025
1.3.5 284 9/17/2025
1.3.4 287 9/16/2025
1.3.3 278 9/16/2025
1.3.2 277 9/15/2025
1.3.1 75 9/12/2025
1.3.0 299 8/25/2025
1.2.65 176 3/3/2025
1.2.64 137 1/29/2025
1.2.63 130 1/27/2025
1.2.62 118 1/8/2025