The issue now is if a query value is optional, but a value is provided, the url will not generate because there is a default value of Optional but no token on the underlying route url matches it. It seems this issue is similar to the contraints issue with query parameters. I think default values for query parameters have to be treated like the contraints, and handled post processing for the underlying route code.
Ex:
GET("/admin/news/article/new?{categoryId:long?}")
Url.Route(new { action = "article", controller = "news" }) == /admin/news/article/new
Url.Route(new { action = "article", controller = "news", categoryId = 12 }) == null
the second one should equal /admin/news/article/new?categoryId=12
This is technically a continuation of [#216]
The issue now is if a query value is optional, but a value is provided, the url will not generate because there is a default value of Optional but no token on the underlying route url matches it. It seems this issue is similar to the contraints issue with query parameters. I think default values for query parameters have to be treated like the contraints, and handled post processing for the underlying route code.
Ex:
GET("/admin/news/article/new?{categoryId:long?}")
Url.Route(new { action = "article", controller = "news" }) == /admin/news/article/new Url.Route(new { action = "article", controller = "news", categoryId = 12 }) == null the second one should equal /admin/news/article/new?categoryId=12