// GetAll public IList <TModel> GetAll <TModel>(bool withDeleted = false) where TModel : BaseViewModel { string cacheName = typeof(TModel).Name; List <TModel> lst = null; if (withDeleted) { // Silinmiş Kayıtlar Dahil lst = _cache.Get <List <TModel> >(cacheName + "_ALL"); if (lst == null) { lst = _repository.GetAll <TModel>().ToList(); _cache.Set(cacheName + "_ALL", lst); } } else { lst = _cache.Get <List <TModel> >(cacheName); if (lst == null) { lst = _repository.GetAll <TModel>().Where(k => k.Deleted == false).ToList(); _cache.Set(cacheName, lst); } } return(lst); }
public void LoadDefinitionsFromStorage() { foreach (var definition in _repository.GetAll()) { try { _loader.LoadDefinition(definition); } catch (Exception ex) { _logger.LogError(default(EventId), ex, $"Error loading definition {definition.Id}"); } } }
public IEnumerable <IDefinition> GetAll() { IEnumerable <IDefinition> results = _definitionRepo.GetAll(); return(results); }