SmartSoftware.IntegrationEventLogEF 1.0.0

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

SmartSoftware.IntegrationEventLogEF

This module implements the Transactional Outbox Pattern. It ensures that Domain logic and Integration Events are saved within the same local database transaction, guaranteeing eventual consistency between services.

1. Overview

When a business operation occurs (e.g., User Registered), we need to notify other microservices. To prevent data inconsistency (where the database is updated but the message bus fails), we save the event into a local "Outbox" table ( IntegrationEventLog) using the same transaction as the business data.

2. Core Components

IntegrationEventLogEntry

The entity representing the log record.

  • EventTypeName: Full .NET type name of the event (used for deserialization).
  • Content: JSON representation of the event data.
  • State: Current status (NotPublished, InProgress, Published, PublishedFailed).
  • TransactionId: Links the event to the specific DB transaction.

IntegrationEventLogService

Provides methods to:

  • SaveEventAsync: Persists the event into the log table.
  • RetrieveEventLogsPendingToPublishAsync: Fetches events that haven't been sent yet.
  • MarkEventAsPublishedAsync: Updates status after successful bus delivery.

3. Database Schema

Column Type Nullable Description
EventId Guid No Primary Key.
EventTypeName nvarchar(max) No Full namespace and class name.
Content nvarchar(max) No Serialized JSON data.
State int No Enum for publication status.
TransactionId Guid No The ID of the local DB transaction.
CreationTime datetime2 No Timestamp of the event creation.

4. Setup & Configuration

DbContext Integration

In your ApplicationDbContext, you must register the log entity:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    // Configure the IntegrationEventLogEntry table
    modelBuilder.UseIntegrationEventLogs();
}

Dependency Injection

Register the service in Program.cs:

builder.Services.AddTransient<IIntegrationEventLogService, IntegrationEventLogService>();
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.0.0 130 1/14/2026