Thursday, June 29, 2017

I want a variable at the route of an Microsoft.AspNetCore.Mvc.Controller action to have a different name than the same variable at the method signature because I'm a tool.

You're very special. Here is how you may have what you want:

[HttpGet]
[Route("api/foo/{id}")]
public Foo GetFooById([Bind(Prefix = "id")]int fooId)
{

No comments:

Post a Comment