Class ChaparMassTransitOutboxExtensions
Extension methods for configuring Chapar to use the native MassTransit outbox instead of Chapar's custom outbox tables.
Inherited Members
Namespace: Chapar.MassTransit.Outbox.Extensions
Assembly: Chapar.MassTransit.Outbox.dll
Syntax
public static class ChaparMassTransitOutboxExtensions
Methods
| Edit this page View SourceAddChaparMassTransitOutbox<TDbContext>(IServiceCollection, Action<MassTransitOutboxOptions>?)
Replaces Chapar's custom outbox with MassTransit's built‑in transactional outbox.
Requires an Entity Framework Core TDbContext that will host
the standard MassTransit outbox tables (OutboxMessage, OutboxState, InboxState).
Declaration
public static IServiceCollection AddChaparMassTransitOutbox<TDbContext>(this IServiceCollection services, Action<MassTransitOutboxOptions>? configure = null) where TDbContext : DbContext
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The IServiceCollection. |
| Action<MassTransitOutboxOptions> | configure | Optional action to customize MassTransit outbox options. |
Returns
| Type | Description |
|---|---|
| IServiceCollection | The same service collection for chaining. |
Type Parameters
| Name | Description |
|---|---|
| TDbContext | The application's DbContext type. |
Remarks
Call this method instead of AddChaparOutboxEntityFramework.
Must be called before AddChaparMassTransit so that the callback
is registered before the bus is configured.
No changes are required in the business code that uses IChaparBus.
AddMassTransitOutboxEntities(ModelBuilder)
Adds the standard MassTransit outbox tables to the application's DbContext.
Declaration
public static ModelBuilder AddMassTransitOutboxEntities(this ModelBuilder modelBuilder)
Parameters
| Type | Name | Description |
|---|---|---|
| ModelBuilder | modelBuilder | The ModelBuilder instance. |
Returns
| Type | Description |
|---|---|
| ModelBuilder | The ModelBuilder for chaining. |
Remarks
Call this method inside your OnModelCreating override to configure
the OutboxMessage, OutboxState, and InboxState tables.