public T Get <T>(string key, Func <string, T> getter) where T : class
        {
            var val = _contextProvider.Get <T>(key);

            if (val == null)
            {
                val = getter(key);
                _contextProvider.Set(key, val);
            }

            return(val);
        }
Exemple #2
0
        public string Get()
        {
            var content = _contextProvider.Get <string>(Key);

            if (!string.IsNullOrEmpty(content))
            {
                return(content);
            }

            var request = _requestContextProvider.Get();

            content = GetRawContent(request);
            _contextProvider.Set(Key, content);

            return(content);
        }
Exemple #3
0
 public UserStore(IContextProvider context)
 {
     _context     = context;
     _dbEntitySet = _context.Set <AspNetUser>();
 }
 public void Set(string token)
 {
     _contextProvider.Set(TokenKey, token);
 }