Find MediatR Requests without Handlers
You’ve run into it. MediatR throwing an InvalidOperationException when you didn’t have a matching handler for a request. There’s a fairly simple solution to prevent this: Find MediatR Requests without Handlers. So here’s some quick code you can throw in a unit test to verify you don’t have any missing handlers. Find MediatR Requests without Handlers View the code on Gist. The above code uses reflection to get all the IRequest<>, RequestHandler<> and RequestHandler<,>. Also worth mentioning it leverages Autofac for the IsClosedTypeOf method in the linq query. Usage Here’s a quick unit test that shows it’s usage for finding… Read More »Find MediatR Requests without Handlers