public async Task <IEnumerable <TEntity> > FindAll(Expression <Func <TEntity, bool> > predicate) { var entities = await LookupRepository.FindAll(predicate); Cache.AddOrSet(entities); return(entities); }
public void Add(QueryRequest queryRequest, IEnumerable <TEntity> entities) { Cache.AddOrSet(entities); if (queryRequestToIdsCache.Count > EntityConfig.MaxQueries) { queryRequestToIdsCache.Remove(queryRequestToIdsCache.First().Key); } queryRequestToIdsCache.Add(queryRequest, entities.Select(e => e.Id).ToList()); }
public async Task Add(TEntity entity) { await AlterRepository.Add(entity); Cache.AddOrSet(entity); }
public async Task AddMany(IEnumerable <TEntity> entities) { await BatchRepository.AddMany(entities); Cache.AddOrSet(entities); }