[release/6.0-rc1] Add ParameterInfo argument to BindAsync and return specific type instead of object#35795
Merged
dougbu merged 4 commits intorelease/6.0-rc1from Aug 27, 2021
Conversation
davidfowl
approved these changes
Aug 26, 2021
BrennanConroy
approved these changes
Aug 26, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #35791 to release/6.0-rc1
/cc @halter73
Customer Impact
Before rc1, customers who wanted to advanced parameter binding with minimal API giving full access to the request's HttpContext, could not do so.
In rc1, we added support for parameter binding via a public static
BindAsyncmethod on the parameter's declaring type:The big thing it's missing is details about the parameter other than the type like the parameter's name and attributes, so we decided to add a
ParameterInfoargument toBindAsync. We also decided that it would be better to require the return type to beValueTask<{DeclaringType}>instead ofValueTask<object?>for better type-safety.So after this change, we will not look for the old
BindAsyncsignature on the parameter's declaring type, but instead the following:Before:
After:
We don't want to have a breaking change between rc1 and rc2 which is why we're asking to get this change in rc1 now.
Regression?
Packaging changes reviewed?
Verification
Risk
Support for
BindAsyncis entirely new in rc1.