Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Attribute Routing: Design a scheme for token replacement in templates #738

@rynowak

Description

@rynowak

We've had a few requests for the ability to write code like this:

[Route("api/{controller}/{action}/id?}")]
class BaseController : Controller
{
...
}

class BlogController : BaseController
{
...
}

Ultimately what the user wants here is for the {controller} token to be replaced with the controller name and the {action} token to be replaced with the action name(s).

We should consider whether or not this is truly a parameter (with parameter syntax) or is just token replacement (with different syntax).

Includes discussion about what the exact meaning of [Route("api/{controller}/{action}/id?}")] is. Is this token replacement? If we support token replacement, are these specific parameters still supported.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions