Skip to content

Support response generators for the endpoint results#1342

Merged
brockallen merged 5 commits intomainfrom
brock/result-generators-2
Jul 19, 2023
Merged

Support response generators for the endpoint results#1342
brockallen merged 5 commits intomainfrom
brock/result-generators-2

Conversation

@brockallen
Copy link
Copy Markdown
Member

This PR introduces the IEndpointResultGenerator<T> type which is designed to render the IEndpointResult objects that are returned from the IEndpointHandler in our endpoint routing architecture.

Previously the IEndpointResult would render themselves, but was difficult for customers to override or change how they did this. Now our built in IEndpointResult classes use a new base class EndpointResult which will resolve a IEndpointResultGenerator<T> from DI to do the rendering. This allows customers to register their own IEndpointResultGenerator<T> and can change how they are rendered to the HTTP response.

This PR is also designed to be backwards compatible with the prior approach, such that any custom IEndpointResult or IEndpointHandler should still work the way they used to.

Closes: #1129

Replaces: #1330

@brockallen brockallen added this to the 7.0 milestone Jun 26, 2023
@brockallen brockallen requested a review from josephdecock June 26, 2023 17:37
@brockallen brockallen force-pushed the brock/result-generators-2 branch from 48b3e22 to ed69087 Compare July 19, 2023 15:41
@brockallen
Copy link
Copy Markdown
Member Author

Updated for [re-]review @josephdecock

@brockallen brockallen force-pushed the brock/result-generators-2 branch from ed69087 to 0b74cb0 Compare July 19, 2023 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider result generator in DI for our result objects

2 participants