Skip to content

Validate Dynamic Route Values #11536

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

Closed
3 tasks done
rynowak opened this issue Jun 25, 2019 · 0 comments
Closed
3 tasks done

Validate Dynamic Route Values #11536

rynowak opened this issue Jun 25, 2019 · 0 comments
Assignees
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed Validation This issue is used to track validation efforts

Comments

@rynowak
Copy link
Member

rynowak commented Jun 25, 2019

Summary

Background: #4221
PR: #8955

It's super common in the older versions of MVC to subclass Route and implement dynamic generation of route values (usually using a database).

Ex:

  1. Write a route like product}/{**slug}
  2. Store the mapping between product slugs and controller/action route values in a database
  3. Implement an IRouter that does a database lookup

The key of this is that the user doesn't really write any significant routing functionality, they just want to map a parameter to a controller/action

Checklist

Example: https://github.com/aspnet/AspNetCore/pull/8955/files#diff-5a433b2664ee6b8ae7b9717bc51d3518

  • Can write a DynamicRouteValueTransformer for controllers
  • Can write a DynamicRouteValueTransformer for pages
  • Can still use policies like [Host] or [Consumes] in conjunction with this feature
@rynowak rynowak added area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Validation This issue is used to track validation efforts labels Jun 25, 2019
@rynowak rynowak added this to the 3.0.0-preview7 milestone Jun 25, 2019
@rynowak rynowak self-assigned this Jun 26, 2019
@rynowak rynowak closed this as completed Jun 26, 2019
@rynowak rynowak added the Done This issue has been fixed label Jun 26, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates Done This issue has been fixed Validation This issue is used to track validation efforts
Projects
None yet
Development

No branches or pull requests

1 participant