Skip to content
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

Implement a minimal version of MapAction #29684

Closed
halter73 opened this issue Jan 27, 2021 · 3 comments
Closed

Implement a minimal version of MapAction #29684

halter73 opened this issue Jan 27, 2021 · 3 comments
Assignees
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-minimal-actions Controller-like actions for endpoint routing
Milestone

Comments

@halter73
Copy link
Member

halter73 commented Jan 27, 2021

This issue tracks what should be included in the first PR that adds a MapAction extension method to IEndpointRouteBuilder.

Requirements:

  • Support for binding [FromBody], [FromRoute], [FromQuery], [FromHeaders], [FromService] parameters.
    • [FromBody] will be JSON-only for the first iteration
    • [FromQuery] will likely not support complex types due to MVC-isms
  • Serialize return value as JSON-only for first iteration
  • Use [Route] attribute instead of an explicit parameter.
  • HttpContext injection

Follow up:

  • Benchmarks (Add benchmarks for MapAction #29915)
  • Remove LINQ from startup path
  • Input and output formatters
  • Model binding validation
  • Swagger support (IApiDescriptionGroupCollectionProvider implementation)
  • MapAction filters

Is your feature request related to a problem? Please describe.

I want to be able to use MVC features like parameter binding without having to write a Controller.

Describe the solution you'd like

A MapAction extension method for IEndpointRouteBuilder that accepts controller action-like delegates.

@halter73 halter73 added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-minimal-actions Controller-like actions for endpoint routing labels Jan 27, 2021
@halter73 halter73 added this to the 6.0-preview2 milestone Jan 27, 2021
@halter73 halter73 self-assigned this Jan 27, 2021
@Tratcher
Copy link
Member

What about [FromForm]?

@halter73
Copy link
Member Author

I think [FromForm] will come later if at all because of its MVC-isms and because it's not really used much for APIs. For the first round, we're only going to support JSON for complex types. Maybe we can support it for simple stuff though.

@davidfowl
Copy link
Member

davidfowl commented Jan 29, 2021

I think you should add support [FromForm] as well, just not for complex objects (yet).

@mkArtakMSFT mkArtakMSFT added the enhancement This issue represents an ask for new feature or an enhancement to an existing one label Feb 8, 2021
@ghost ghost added Done This issue has been fixed and removed Working labels Feb 22, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Mar 24, 2021
@amcasey amcasey added the area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc label Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed enhancement This issue represents an ask for new feature or an enhancement to an existing one feature-minimal-actions Controller-like actions for endpoint routing
Projects
None yet
Development

No branches or pull requests

5 participants