R4MVC is a Roslyn code generator for ASP.NET Core MVC apps that creates strongly typed helpers that eliminate the use of literal strings in many places
The [BindAttribute] is a strange but useful way to "rename" action parameter names. If its Prefix property is set, the routing system will use that name instead of the method's variable name. So if I write this:
public IActionResult Details([Bind(Prefix = "id")] productId)
{
...
}
Then the common "{controller=Home}/{action=Index}/{id?}" will match this action method.
I know this is not a common scenario, but I've used a lot in our MVC project, so this should be implemented in order to be able to upgrade to ASP.NET Core. For that reason, I'm going to add a pull request for this feature.
The
[BindAttribute]
is a strange but useful way to "rename" action parameter names. If itsPrefix
property is set, the routing system will use that name instead of the method's variable name. So if I write this:Then the common
"{controller=Home}/{action=Index}/{id?}"
will match this action method.I know this is not a common scenario, but I've used a lot in our MVC project, so this should be implemented in order to be able to upgrade to ASP.NET Core. For that reason, I'm going to add a pull request for this feature.