Esempio n. 1
0
        public TValue Get <TValue>() where TValue : class
        {
            string     key   = _keyEvaluator.GetKey <TValue>();
            RedisValue value = _database.StringGet(key);

            return(JsonConvert.DeserializeObject <TValue>(value));
        }
        public TValue Get <TValue>() where TValue : class
        {
            string key   = _keyEvaluator.GetKey <TValue>();
            string value = ConfigurationManager.AppSettings[key];

            if (value == null)
            {
                throw new KeyNotFoundException("Key " + key + " not found");
            }

            return(JsonConvert.DeserializeObject <TValue>(value));
        }