v10.2.0
What's Changed
Added an EF Core interceptor for dispatching events by @pdeffendol in #60
This should replace manual setup of domain event dispatching in your DbContext. Add the interceptor when registering your application's services:
// ...
builder.Services
.AddMediatR(configuration => configuration.RegisterServicesFromAssemblyContaining<Program>())
.AddSingleton<IDomainEventDispatcher, MediatRDomainEventDispatcher>();
// ...
builder.Services.AddSingleton<DispatchDomainEventsInterceptor>();
builder.Services.AddDbContext<ApplicationDbContext>((sp, options) =>
{
options.AddInterceptors(sp.GetRequiredService<DispatchDomainEventsInterceptor>());
options.UseSqlServer(connectionString);
});
// ...Full Changelog: v10.1.0...v10.2.0