using MediatR; namespace Ds.Module.MediatR { public class LocalEventBus : ILocalEventBus { private readonly IPublisher _publisher; public LocalEventBus(IPublisher publisher) { _publisher = publisher; } public async Task Publish(IDomainEvent domainEvent, CancellationToken cancellationToken = default) { await _publisher.Publish(domainEvent, cancellationToken); } public async Task Publish(T domainEvent, CancellationToken cancellationToken = default) where T : IDomainEvent { await _publisher.Publish(domainEvent, cancellationToken); } }