SmartSoftware.IntegrationEventLogEF
1.0.0
dotnet add package SmartSoftware.IntegrationEventLogEF --version 1.0.0
NuGet\Install-Package SmartSoftware.IntegrationEventLogEF -Version 1.0.0
<PackageReference Include="SmartSoftware.IntegrationEventLogEF" Version="1.0.0" />
<PackageVersion Include="SmartSoftware.IntegrationEventLogEF" Version="1.0.0" />
<PackageReference Include="SmartSoftware.IntegrationEventLogEF" />
paket add SmartSoftware.IntegrationEventLogEF --version 1.0.0
#r "nuget: SmartSoftware.IntegrationEventLogEF, 1.0.0"
#:package SmartSoftware.IntegrationEventLogEF@1.0.0
#addin nuget:?package=SmartSoftware.IntegrationEventLogEF&version=1.0.0
#tool nuget:?package=SmartSoftware.IntegrationEventLogEF&version=1.0.0
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 | Versions 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. |
-
net9.0
- Microsoft.EntityFrameworkCore.SqlServer (>= 9.0.7)
- SmartSoftware.EventBus (>= 1.0.0)
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 |