Mediator endpoints should have support for Result<T> when making requests. This would allow us to use the result type end-to-end.
This feature should be added side-by-side the existing implementation, and should not include major breaking changes. This allows consumers to migrate existing endpoints.
Adding this to the server implementation shouldn't be too hard. IRequestHandlers will need to have their signatures updated, and the endpoint mapper should accept an IRequestHandler<T1, T2 OR IRequestHandler<T1, Result<T2>>.
The client implementation is likely to be trickier, as it just has a Send method, whose return signature we can't modify. Ideally we would update this to return a Result, but we need to avoid breaking changes. Instead we may add a SendResult (or similar), which will nicely deserialise results.
Mediator endpoints should have support for
Result<T>
when making requests. This would allow us to use the result type end-to-end.This feature should be added side-by-side the existing implementation, and should not include major breaking changes. This allows consumers to migrate existing endpoints.
Adding this to the server implementation shouldn't be too hard.
IRequestHandler
s will need to have their signatures updated, and the endpoint mapper should accept anIRequestHandler<T1, T2
ORIRequestHandler<T1, Result<T2>>
.The client implementation is likely to be trickier, as it just has a, but we need to avoid breaking changes. Instead we may add a
Send
method, whose return signature we can't modify. Ideally we would update this to return a ResultSendResult
(or similar), which will nicely deserialise results.