Skip to content

Add support for BindAsync without ParameterInfo #36505

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 16, 2021
Merged

Conversation

BrennanConroy
Copy link
Member

Fixes #36415

Prefers BindAsync(HttpContext, ParameterInfo) over BindAsync(HttpContext).

@BrennanConroy BrennanConroy added the old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels label Sep 14, 2021
@@ -128,12 +131,18 @@ public bool HasTryParseMethod(ParameterInfo parameter)
return _stringMethodCallCache.GetOrAdd(type, Finder);
}

public Expression? FindBindAsyncMethod(ParameterInfo parameter)
public (Expression?, int) FindBindAsyncMethod(ParameterInfo parameter)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public (Expression?, int) FindBindAsyncMethod(ParameterInfo parameter)
public (Expression? Expression, int ParamCount) FindBindAsyncMethod(ParameterInfo parameter)

Would this be better @davidfowl ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this changed much but it's fine

Copy link
Member

@halter73 halter73 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice test coverage!

@BrennanConroy
Copy link
Member Author

/backport to release/6.0

@github-actions
Copy link
Contributor

@BrennanConroy BrennanConroy merged commit f6efa13 into main Sep 16, 2021
@BrennanConroy BrennanConroy deleted the brecon/bindasync branch September 16, 2021 03:31
@ghost ghost added this to the 7.0-preview1 milestone Sep 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support BindAsync() without ParameterInfo for Minimal APIs
3 participants