Aspectacular.RequestCache.TryGet C# (CSharp) Method

TryGet() public method

public TryGet ( string key, object &val ) : bool
key string
val object
return bool
        public bool TryGet(string key, out object val)
        {
            val = null;

            key = "RequestCache_" + key;

            lock(HttpContext.Current.Items)
            {
                if(!HttpContext.Current.Items.Contains(key))
                    return false;

                val = HttpContext.Current.Items[key];
            }

            return true;
        }