Rebel.Cms.Web.RouteDataExtensions.GetOptionalValue C# (CSharp) Method

GetOptionalValue() public static method

public static GetOptionalValue ( this routeData, string key ) : object
routeData this
key string
return object
        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;
        }