Skip to content

Support response generators for the endpoint results#1330

Closed
brockallen wants to merge 13 commits intomainfrom
brock/result-generators
Closed

Support response generators for the endpoint results#1330
brockallen wants to merge 13 commits intomainfrom
brock/result-generators

Conversation

@brockallen
Copy link
Copy Markdown
Member

@brockallen brockallen commented Jun 7, 2023

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

@brockallen brockallen requested a review from josephdecock June 7, 2023 20:15
@brockallen brockallen marked this pull request as ready for review June 7, 2023 20:15
@brockallen brockallen added this to the 7.0 milestone Jun 7, 2023
@brockallen
Copy link
Copy Markdown
Member Author

This PR got borked by rebasing. Will fix.

@brockallen brockallen marked this pull request as draft June 26, 2023 17:13
@brockallen brockallen removed this from the 7.0 milestone Jun 26, 2023
@brockallen brockallen closed this Jun 26, 2023
@brockallen brockallen deleted the brock/result-generators branch June 26, 2023 17:37
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

1 participant