Rebel.Cms.Web.RouteDataExtensions.GetOptionalValue C# (CSharp) 메소드

GetOptionalValue() 공개 정적인 메소드

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