What would be the correct regex to restrict the MVC route passing the bool? For example, I have the following route:
routes.MapRoute("MenuRouteWithExtension", "Menu.mvc/{action}/{projectId}/{dealerId}/{isGroup}", new { controller = "Menu", action = "RedirectUrl", projectId = "", dealerId = "", isGroup = "" } new { projectId = @"\d+", dealerId = @"\d+", isGroup = @"???" });
Basically, I need to know what would be true instead ??? in the above code example.
Thus, the Action on the other end can use the bool type, for example:
public ActionResult RedirectUrl(int projectId, int dealerId, bool isGroup)
Thank you in advance for your input.
asp.net-mvc boolean constraints routes
Jessy houle
source share