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.

Model binding - parameter name aliasing #563

@kichalla

Description

@kichalla

Scenario:
A rest route like {controller}/{id?} could be used by multiple controllers. Each controller might want to use a different parameter name for id (ex: customerId, orderId) in their actions.

We need an aliasing feature (for example, Web API has a Name property on the FromUri attribute) through which a user can supply a different name than the one defined on route variable.

Web API example: public IActionResult Get([FromUri(Name='id') int orderId])

Note:
The above scenario could probably be accomplished by using Attribute Routing where the route template can be defined close to the action with different variable names. But here we would be forcing users to use attribute routing which is not good.
Also action's parameter values could be coming from Query String or other custom value providers(ex: reading from Request Headers) and aliasing could be required in these scenarios too.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions