Need to implement a null mediator pattern #865
-
Need a null mediatr along the lines of following: public class NoMediator : IMediator
{
public IAsyncEnumerable<TResponse> CreateStream<TResponse>(IStreamRequest<TResponse> request, CancellationToken cancellationToken = default)
{
return default(IAsyncEnumerable<TResponse>);
}
public IAsyncEnumerable<object> CreateStream(object request, CancellationToken cancellationToken = default)
{
return default(IAsyncEnumerable<object>);
}
public Task Publish(object notification, CancellationToken cancellationToken = default)
{
return Task.CompletedTask;
}
public Task Publish<TNotification>(TNotification notification, CancellationToken cancellationToken = default) where TNotification : INotification
{
return Task.CompletedTask;
}
public async Task<TResponse> Send<TResponse>(IRequest<TResponse> request, CancellationToken cancellationToken = default)
{
return default(TResponse);
}
public async Task<object> Send(object request, CancellationToken cancellationToken = default)
{
return Task.CompletedTask;
}
} The reason for this is - I supply it into DbContext because I need mediatR to dispatch uncommited domain events from there. What I have been getting since taking the latest version is:
Any ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
It looks like you need to update your implementation. There were new methods added to |
Beta Was this translation helpful? Give feedback.
It looks like you need to update your implementation. There were new methods added to
IMediator
.