private ITypedRouteBuilder AddRoute(string template, Action<ITypedRoute> configuration, params string[] httpMethods)
{
// Action template should be replaced because we are actually using attribute route models.
var route = new TypedRoute(template.Trim('/').Replace("{action}", "[action]"), httpMethods);
configuration(route);
if (routes.ContainsKey(route.ControllerType))
{
var controllerActions = routes[route.ControllerType];
controllerActions.Add(route);
}
else
{
var controllerActions = new List<TypedRoute> { route };
routes.Add(route.ControllerType, controllerActions);
}
return this;
}
}