Esempio n. 1
0
        public async Task <IEnumerable <TEntity> > GetAllEntitiesAsync()
        {
            var entities = await _cache.GetAsync <IEnumerable <TEntity> >(GET_ALL_CACHE_KEY);

            if (entities == null)
            {
                entities = await this.Repository.SelectAllAsync();

                _ = _cache.AddAsync(GET_ALL_CACHE_KEY, entities);
            }
            return(entities);
        }