I've currently run into a scenario where I'd like to re-use much of an existing controller and not have to worry about creating new files.
In my area registration on an MVC3 website I have the following code:
```
context.MapRoute(
"AdminMdsWebRule",
"Admin/MDS/WebRule/{action}/{id}",
new { action = "Index", controller = "WebRule", id = UrlParameter.Optional, interfaceModel = typeof(UIAssessment) },
new string[] { "WebUI.Controllers" }
);
context.MapRoute(
"AdminUBWebRule",
"Admin/UB/WebRule/{action}/{id}",
new { action = "List", controller = "WebRule", id = UrlParameter.Optional, interfaceModel = typeof(MasterUBClaim) },
new string[] { "WebUI.Controllers" }
);
```
Essentially this uses the pattern matching feature to properly point to the same controller in the base of the application, it also uses this opportunity to create a route value that identifies a class type to be used as an interface.
The issue comes when the Helpers are generating URLs, because the route map has two entries with the same controller name, when the url is generated it takes the first one and uses that as the source for generating the url.
It would be nice if it tried to apply the pattern matching to instances where multiple paths are possible.
In my area registration on an MVC3 website I have the following code:
```
context.MapRoute(
"AdminMdsWebRule",
"Admin/MDS/WebRule/{action}/{id}",
new { action = "Index", controller = "WebRule", id = UrlParameter.Optional, interfaceModel = typeof(UIAssessment) },
new string[] { "WebUI.Controllers" }
);
context.MapRoute(
"AdminUBWebRule",
"Admin/UB/WebRule/{action}/{id}",
new { action = "List", controller = "WebRule", id = UrlParameter.Optional, interfaceModel = typeof(MasterUBClaim) },
new string[] { "WebUI.Controllers" }
);
```
Essentially this uses the pattern matching feature to properly point to the same controller in the base of the application, it also uses this opportunity to create a route value that identifies a class type to be used as an interface.
The issue comes when the Helpers are generating URLs, because the route map has two entries with the same controller name, when the url is generated it takes the first one and uses that as the source for generating the url.
It would be nice if it tried to apply the pattern matching to instances where multiple paths are possible.