Creating an anonymous class like new {Model.ProductID}
Will actually create the object like so:
new {ProductId = Model.ProductID}
Which Url.Action
will write out as &ProductId=123
The default Model binder is case insensitive and will be able to map this to int productId
signature of your GetImage
controller method.
Whereas Model.ProductID
will just be an integer - this is typically only mapped to id
in a default MapRoute
.