Exemple #1
0
        public void Set(string key, TEntity entity)
        {
            var cacheEntity = new RedisCacheEntity <TEntity>
            {
                Id                 = _domain + key,
                Domain             = _domain,
                Entity             = entity,
                AbsoluteExpiration = DateTime.Now.AddHours(_hours)
            };

            _typedClient.Store(cacheEntity);
        }
Exemple #2
0
        public void Set(string key, IEnumerable <TEntity> entity, bool isEnumerable)
        {
            var cacheEntity = new RedisCacheEntity <TEntity>
            {
                Id                 = _domain + key,
                Domain             = _domain,
                Collection         = entity,
                AbsoluteExpiration = DateTime.Now.AddHours(_hours)
            };

            _typedClient.Store(cacheEntity);
        }