private void MapRouteSurfaceControllers(RouteCollection routes, IEnumerable<SurfaceMetadata> surfaceControllers)
{
foreach (var s in surfaceControllers.Where(x => x.PluginDefinition == null))
{
var route = routes.MapRoute(
string.Format("rebel-{0}-{1}", "surface", s.ControllerName),
AreaName + "/Surface/" + s.ControllerName + "/{action}/{id}",//url to match
new { controller = s.ControllerName, action = "Index", id = UrlParameter.Optional },
new[] { s.ComponentType.Namespace }); //only match this namespace
route.DataTokens.Add("area", AreaName); //only match this area
route.DataTokens.Add("rebel", "surface"); //ensure the rebel token is set
}
}