internal static void RegisterRoutesToMethodsWithAttributes(Assembly[] assemblies)
{
List<MapRouteParams> routeParams = UrlRoutingUtility.GetRouteParamsFromAttributes(
Project.RelevantAssemblies.ToArray());
routeParams.Sort((a, b) => a.Order.CompareTo(b.Order));
foreach (MapRouteParams rd in routeParams)
{
log.DebugFormat("Automatically registering route '{0}' for controller '{1}Controller.{2}' (Priority = {3}, Name = {4})",
rd.Path, rd.ControllerName, rd.ActionName, rd.Order, rd.RouteName ?? "<null>");
rd.Defaults["controller"] = rd.ControllerName;
rd.Defaults["action"] = rd.ActionName;
string name = rd.RouteName;
if (string.IsNullOrEmpty(name))
name = string.Concat(rd.ControllerName, ".", rd.ActionName);
UrlRoutingUtility.MapRoute(name, rd.Path, rd.Defaults, rd.Constraints, new[] { rd.ControllerNamespace });
}
}