Exemple #1
0
        public async Task <IEnumerable <TEntity> > FindAll(Expression <Func <TEntity, bool> > predicate)
        {
            var entities = await LookupRepository.FindAll(predicate);

            Cache.AddOrSet(entities);
            return(entities);
        }
Exemple #2
0
 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);
        }
Exemple #4
0
        public async Task AddMany(IEnumerable <TEntity> entities)
        {
            await BatchRepository.AddMany(entities);

            Cache.AddOrSet(entities);
        }