private void EnsureCache() { lock (_cache) { if (!_cache.Any()) { var all = _repository.All(); _cache = all.ToDictionary(c => c.Key.ToLower(), c => c.Value); } } }
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)); }
public IEnumerable <Config> All() { return(_repository.All()); }