alexnoddings / Tyne

C# libaries designed for making Line of Business Blazor apps more efficiently.
https://alexnoddings.github.io/Tyne/
MIT License
2 stars 0 forks source link

Integrate `Result<T>` into MediatorEndpoints #79

Closed alexnoddings closed 6 months ago

alexnoddings commented 1 year ago

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.

alexnoddings commented 6 months ago

HTTP Mediator work tracked in #116.