public static bool TryGetRouteValue(this HttpRouteValueDictionary routeValues, string key, out object value) { if (routeValues.TryGetValue(key, out value)) { return(true); } return(routeValues.GetSubRoutes()?.FirstOrDefault()?.Values.TryGetValue(key, out value) ?? false); }
public static bool ContainsRouteValue(this HttpRouteValueDictionary routeValues, string key) { if (routeValues.ContainsKey(key)) { return(true); } return(routeValues.GetSubRoutes()?.FirstOrDefault()?.Values.ContainsKey(key) ?? false); }