-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Support F# Async<'T>
as an awaitable type in minimal APIs
#46773
Comments
Unfortunately |
Yes, although it is already supported in the framework dynamically for controller action methods. |
Why not just use task { ... } directly? My experience with minimal apis and F# is that you need a dedicated set of Func overloads anyway or else you have to littler your code with explicit Func annotations everywhere |
Triage: We think we might've missed adding support for this scenario and would welcome any PRs! |
We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process. |
is there any update on this? |
Is there an existing issue for this?
Is your feature request related to a problem? Please describe the problem.
The F#
Async<'T>
type is supported as an awaitable return type for ASP.NET Core controller methods, but not for endpoints added via the.Map*
minimal APIs extension methods.Describe the solution you'd like
I'd like to be able to return F# async values and have them awaited when using minimal APIs endpoints just as I can for controller action methods.
Examples
Basic controller example:
Minimal APIs example:
Additional context
I can perform the conversion myself using code like this:
But if I do so, I lose metadata from the original delegate, including parameter names, which affects the generated Swagger/Open API definition, among other things.
The text was updated successfully, but these errors were encountered: