MediatR Behaviors
I was happy and surprised to see that MediatR v3.0 was released yesterday. One of the new features, which I was really looking forward to are pipeline behaviors. A pipeline behavior is an implementation of IPipelineBehavior<TRequest, TResponse>. It represents a similar pattern to filters in ASP.NET MVC/Web API or pipeline behaviors in NServiceBus. Changes There are a couple major breaking changes to v3. All of them I’m fairly happy about actually. Messages There is no distinction between sync, async (cancellable) requests or notifications. You simply implement either IRequest or INotification. You must still create the appropriate handler via either IRequestHandler, IAsyncRequestHandler, ICancellableAsyncRequestHandler. Async To… Read More »MediatR Behaviors