/// <summary> /// Get the route entry for the verb and path including any path parameters. /// Throws an exception if the route isn't found. /// </summary> public RouteEntry GetRouteEntry(RouteKey key, out PathParams parms) { parms = new PathParams(); RouteEntry entry = Parse(key, parms); if (entry == null) { throw new ApplicationException("The route key " + key.ToString() + " does not exist."); } return(entry); }
/// <summary> /// Add a unique route. /// </summary> public void AddRoute(RouteKey key, RouteEntry route) { routes.ThrowIfKeyExists(key, "The route key " + key.ToString() + " already exists.")[key] = route; }
/// <summary> /// Get the route entry for the verb and path. /// </summary> public RouteEntry GetRouteEntry(RouteKey key) { return(routes.ThrowIfKeyDoesNotExist(key, "The route key " + key.ToString() + " does not exist.")[key]); }