Franz.Common.Messaging.EntityFramework 1.6.2

There is a newer version of this package available.
See the version list below for details.
dotnet add package Franz.Common.Messaging.EntityFramework --version 1.6.2
                    
NuGet\Install-Package Franz.Common.Messaging.EntityFramework -Version 1.6.2
                    
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.Messaging.EntityFramework" Version="1.6.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Franz.Common.Messaging.EntityFramework" Version="1.6.2" />
                    
Directory.Packages.props
<PackageReference Include="Franz.Common.Messaging.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.Messaging.EntityFramework --version 1.6.2
                    
#r "nuget: Franz.Common.Messaging.EntityFramework, 1.6.2"
                    
#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.Messaging.EntityFramework@1.6.2
                    
#: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.Messaging.EntityFramework&version=1.6.2
                    
Install as a Cake Addin
#tool nuget:?package=Franz.Common.Messaging.EntityFramework&version=1.6.2
                    
Install as a Cake Tool

Franz.Common.Messaging.EntityFramework

A specialized library within the Franz Framework designed to integrate Entity Framework Core with messaging workflows. This package ensures transactional consistency for outbox patterns in relational databases, while also supporting polyglot persistence by delegating messaging storage to MongoDB or Azure Cosmos DB when configured.


Features

  • Transactional Filters

    • TransactionFilter to manage database transactions in messaging contexts, ensuring consistency and rollback.
  • Service Registration

    • ServiceCollectionExtensions to simplify the integration of messaging and persistence services.
  • Entity Framework Core Messaging

    • Native support for relational outbox patterns when using EF Core (MariaDB, Postgres, Oracle, SQL Server).
  • Polyglot Messaging Support (new in 1.6.2)

    • Messaging outbox/dead-letter can also be stored in MongoDB or Azure Cosmos DB via unified configuration.
    • Clean abstraction with IMessageStore, so your messaging workflow does not change regardless of provider.

Version Information

  • Current Version: 1.6.2
  • Part of the private Franz Framework ecosystem.

Dependencies

This package relies on:

  • Microsoft.EntityFrameworkCore (8.0.0) – Core EF functionality for database access
  • Microsoft.EntityFrameworkCore.Relational (8.0.0) – Relational database support
  • Franz.Common.EntityFramework.MariaDB – MariaDB provider bootstrap
  • Franz.Common.Messaging.Hosting – Hosting + transaction coordination
  • Franz.Common.MongoDB (new in 1.6.2) – MongoDB messaging provider
  • Franz.Common.AzureCosmosDB (new in 1.6.2) – Cosmos DB messaging provider

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.Messaging.EntityFramework  

Usage

1. Configure Messaging Provider

{
  "Messaging": {
    "Provider": "Postgres" // Options: MariaDb, Postgres, Oracle, SqlServer, Mongo, Cosmos
  },
  "Database": {
    "ConnectionString": "Host=localhost;Database=franz;Username=sa;Password=pass"
  },
  "MongoDb": {
    "ConnectionString": "mongodb://localhost:27017",
    "DatabaseName": "FranzOutbox"
  },
  "CosmosDb": {
    "ConnectionString": "AccountEndpoint=https://your-account.documents.azure.com:443/;AccountKey=your-key;",
    "DatabaseName": "FranzCosmosOutbox"
  }
}

2. Register Messaging Outbox

using Franz.Common.Messaging.EntityFramework.Extensions;

builder.Services.AddMessageStore<MyDbContext>(builder.Configuration);
  • If Provider is Postgres, MariaDb, Oracle, or SqlServer → EF-based outbox via DbContext.
  • If Provider is Mongo → outbox/dead-letter stored in Mongo collections.
  • If Provider is Cosmos → outbox/dead-letter stored in Cosmos containers.

3. Transaction Filters (Relational Only)

When using relational databases, ensure transaction consistency with filters:

using Franz.Common.Messaging.EntityFramework.Transactions;

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

4. Messaging Service Example

public class MessagingService
{
    private readonly IMessageStore _messageStore;

    public MessagingService(IMessageStore messageStore)
    {
        _messageStore = messageStore;
    }

    public async Task PublishAsync(Message message)
    {
        await _messageStore.SaveAsync(message);
    }
}

The code above works the same whether your provider is EF, Mongo, or Cosmos.


Integration with Franz Framework

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

  • Franz.Common.EntityFramework (base EF abstractions)
  • Franz.Common.EntityFramework.MariaDB
  • Franz.Common.EntityFramework.Postgres
  • Franz.Common.EntityFramework.Oracle
  • Franz.Common.EntityFramework.SQLServer
  • Franz.Common.MongoDB (NoSQL messaging)
  • Franz.Common.AzureCosmosDB (NoSQL messaging)
  • Franz.Common.DependencyInjection

Changelog

Version 1.6.2

  • Extended messaging persistence beyond EF: added support for MongoDB and Azure Cosmos DB.
  • Unified config-driven provider selection for messaging outbox/dead-letter (Messaging:Provider).
  • EF relational providers still supported via DbContextBase + StoredMessage entity.
  • Mongo & Cosmos backed by dedicated IMessageStore implementations.
  • All providers expose the same abstraction for transparent messaging workflows.

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 5 10/9/2025
1.6.2 64 10/7/2025
1.5.9 150 9/24/2025
1.5.4 157 9/23/2025
1.5.3 203 9/21/2025
1.5.2 208 9/21/2025
1.5.0 188 9/21/2025
1.4.4 165 9/20/2025
1.3.14 292 9/18/2025
1.3.13 287 9/18/2025
1.3.5 503 9/17/2025 1.3.5 is deprecated.
1.3.4 301 9/16/2025
1.3.3 299 9/16/2025
1.3.2 279 9/15/2025
1.3.1 103 9/12/2025
1.3.0 302 8/25/2025
1.2.65 187 3/3/2025
1.2.64 143 1/29/2025
1.2.63 126 1/27/2025
1.2.62 118 1/8/2025