public void RegisterRoute(IRoute route) { var matchingRoutes = _routes.Where(x => x.Name == route.Name).ToList(); if (matchingRoutes.Count > 0) { foreach (var r in matchingRoutes) { if (route.Match(r.GetParmaNames())) throw new InvalidRouteException(string.Format("There is already a route registered which matches you route name [{0}] and parameters you supplied", route.Name)); } } _routes.Add(route); }
public void RegisterRoute(IRoute route) { var matchingRoutes = _routes.Where(x => x.Name == route.Name).ToList(); if (matchingRoutes.Count > 0) { foreach (var r in matchingRoutes) { if (route.Match(r.GetParmaNames())) { throw new InvalidRouteException(string.Format("There is already a route registered which matches you route name [{0}] and parameters you supplied", route.Name)); } } } _routes.Add(route); }