public void RegisterRoute(string route, Action <IDictionary <string, string> > action, string description = null) { if (string.IsNullOrEmpty(route.Trim())) { throw new InvalidRouteException(string.Format("An empty route is invalid", route)); } var name = ""; var parameters = _routeParser.Parse(route, out name); _commandRouter.RegisterRoute(name, parameters, (p, c, s) => action.Invoke(p), description); }
public void Setup() { foreach (var route in _routes) { _routing.RegisterRoute(route); } }