✅ MediatR Pipeline where TResponse has a generic type
All my API methods return a Result wrapper, like so:
2 Replies
I want to use MediatR's pipeline to log exceptions to a separate database. But I'm not quite sure how to add a third generic type to the IPipelineBehavior. I tried this:
But I get an error that basically says the implementation Type can't be converted to the service type. Any help would be appreciated!
I found the solution here: https://github.com/jbogard/MediatR/issues/182
GitHub
Issue with Generic Wrapper as response type in pipeline · Issue #18...
When adding a Generic request result wrapper to all of my mediator request response types, the pipeline refuses to execute, throwing a generic type constraint exception that the request does not fi...