public static object GetOptionalValue(this RouteData routeData, string key) { return routeData.Values.Any(x => x.Key == key) ? routeData.Values.Where(x => x.Key == key).First().Value : null; }