aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Map dynamic paths (e.g. with tokens and or constraints)

Open vdecristofaro opened this issue 7 years ago • 1 comments

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

I am unable to create dynamic pipeline branches by using IApplicationBuilder.Map. Example. I'm am trying to organize my API project by using different nested applications as described in this Damian Hickey post but I am unable to map a path that contains, for example, version tokens.

Describe the solution you'd like

Be able to map a dynamic path which contains tokens and/or route constraints. Example:

app.Map( "/branch1/{v{version:apiVersion}}/", builderConfig => {
    [...]
}); 

Additional context

Please have a look at the following discussion. A project which reproduce the problem is available here.

vdecristofaro avatar Jan 28 '19 22:01 vdecristofaro

Map is a simple construct designed just for matching exact paths. If you want to do more complex logic, you can use .Use and run your own code, or use routing.

We don't have any plans to add this functionality to .Map.

analogrelay avatar Apr 10 '19 23:04 analogrelay