0
kicks
Using a Parameter Attribute to set a Default Value in MVC
A couple days ago I came across a breaking change in ASP.NET MVC PR4 that wasn’t reported. The breaking change is that defaults from routes are no longer used as defaults for parameters in the action method, if no appropriate parameter is found in the request. So I decided to take this obvious disapointment and turn it in to something I have been thinking about for a long time, but never really had the motivation to impliment. In .NET you are allowed to add attributes to anything that can be defined via reflection, including classes, interfaces, structures, and even return types and parameters of methods.