Ejemplo n.º 1
0
        public GraphqlInAppCacheService(
            CacheConfiguration cacheConfiguration,
            ICachePolicy cachePolicy,
            IScopedServiceProviderResolver serviceProviderResolver)
        {
            _cacheConfiguration = cacheConfiguration;
            _cachePolicy        = cachePolicy;

            switch (cacheConfiguration.ResponseCache)
            {
            case ResponseCacheType.Memory:
                _memoryCache = serviceProviderResolver.GetProvider().GetService <IMemoryCache>();
                break;

            case ResponseCacheType.Distributed:
                _distributedCache = serviceProviderResolver.GetProvider().GetService <IDistributedCache>();
                break;
            }
        }
Ejemplo n.º 2
0
 public DefaultCachePolicy(CacheConfiguration cacheConfiguration)
 {
     _cacheConfiguration = cacheConfiguration;
 }