public static bool ContainsExclusion(this IEnumerable<RouteMatchElement> routeMatches, string absolutePath) { return routeMatches.Cast<RouteMatchElement>().Any(element => element.Type == RouteMatchTypes.Exclude && element.IsMatch(absolutePath)); } }