If I have a router like:
app.UseMvc(config => {
config.MapRoute(
name: "route",
template: "{controller}/{action}/{id?}"
);
});
Is it possible to call methods that have parameter named other than id and still bind value from URL.
public void SetHeight(int height){
//height do not binds value from URL to height
}
public void SetWidth(int width){
//height do not binds value from URL to width
}
public void SetHeight(int id){
//works as expected however I would like to have different
//parameters name for different action on controller
}
public void SetWidth(int id){
//works as expected however I would like to have different
//parameters name for different action on controller
}
Is there some annotation or something similar to enable different parameter names? Something like:
public void SetHeight([FromUrl(name = "id")]int height){
...
}