Example #1
0
 private void EnsureCache()
 {
     lock (_cache)
     {
         if (!_cache.Any())
         {
             var all = _repository.All();
             _cache = all.ToDictionary(c => c.Key.ToLower(), c => c.Value);
         }
     }
 }
Example #2
0
        private Response GetStatus()
        {
            try
            {
                _configRepository.All();
            }
            catch (Exception e)
            {
                return(new PingResource
                {
                    Status = "Error"
                }.AsResponse(Context, HttpStatusCode.InternalServerError));
            }

            return(new PingResource
            {
                Status = "OK"
            }.AsResponse(Context, HttpStatusCode.OK));
        }
Example #3
0
 public IEnumerable <Config> All()
 {
     return(_repository.All());
 }