Class OutboxServiceCollectionExtensions
- Namespace
- Trellis.EntityFrameworkCore
- Assembly
- Trellis.EntityFrameworkCore.Outbox.dll
Registers the transactional outbox relay for a DbContext.
public static class OutboxServiceCollectionExtensions
- Inheritance
-
OutboxServiceCollectionExtensions
- Inherited Members
Methods
AddTrellisOutbox<TContext>(IServiceCollection, Action<OutboxOptions>?)
Registers the outbox relay hosted service for TContext. Pair this with
AddTrellisOutbox(ModelBuilder) in the context's
OnModelCreating and
AddTrellisOutboxInterceptor(DbContextOptionsBuilder)
on the options builder. Domain-event handlers and IReportingDomainEventPublisher must
also be registered (for example via AddDomainEventDispatch(...)). Host startup validates
this publisher and, when integration features are registered, IIntegrationEventPublisher.
public static IServiceCollection AddTrellisOutbox<TContext>(this IServiceCollection services, Action<OutboxOptions>? configure = null) where TContext : DbContext
Parameters
servicesIServiceCollectionThe service collection.
configureAction<OutboxOptions>Optional relay tuning.
Returns
- IServiceCollection
The same service collection for chaining.
Type Parameters
TContextThe application's DbContext that owns the outbox table.