You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
675 B
C#
23 lines
675 B
C#
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>(T domainEvent, CancellationToken cancellationToken = default) where T : IDomainEvent
|
|
{
|
|
await _publisher.Publish(domainEvent, cancellationToken);
|
|
}
|
|
} |