Example #1
0
        /// <summary>
        /// Reads the value for the specified key.
        /// </summary>
        /// <param name="key">The key of the value.</param>
        /// <returns></returns>
        public string Read(string key)
        {
            byte[] data = _protector.Unprotect(
                Convert.FromBase64String(_cache.StringGet(key)));

            return(Encoding.ASCII.GetString(data));
        }
Example #2
0
        /// <summary>
        /// Reads the value for the specified key.
        /// </summary>
        /// <param name="key">The key of the value.</param>
        /// <returns>The value assigned to the specified key.</returns>
        public string Read(string key)
        {
            byte[] data = _protector.Unprotect(
                Convert.FromBase64String(CacheInstance[key]));

            return(Encoding.ASCII.GetString(data));
        }