public CacheService(IMemoryCache memoryCache, IDistributedCacheService distributedCache,
                     IOptions <CacheSettings> cacheSettings)
 {
     _localCache       = memoryCache;
     _distributedCache = distributedCache;
     _cacheSettings    = cacheSettings.Value;
 }
 public GetActiveDrawingHandler(IDrawingRepository drawingRepository, IMapper mapper,
                                IDistributedCacheService distributedCacheService)
 {
     _drawingRepository       = drawingRepository;
     _mapper                  = mapper;
     _distributedCacheService = distributedCacheService;
 }
Пример #3
0
 public UserInfoService(ISecurityDbContext dbcontext, IDistributedCacheService cacheService, IHttpContextAccessor httpContextAccessor, IConfiguration confguration)
 {
     CacheService        = cacheService;
     HttpContextAccessor = httpContextAccessor;
     DbContext           = dbcontext;
     Configuration       = confguration;
 }
Пример #4
0
        public ClientService(OAuthContext context,
                             IConfiguration configuration,
                             IOptions <TenantConfig> tenantConfig,
                             IWebHostEnvironment hostingEnvironment,
                             IPasswordHasher <User> passwordHasher,
                             ProxyService proxyService,
                             IDistributedCacheService distributedCache)
        {
            _context = context;

            _clients = context.Clients;

            _clientConfiguration = context.ClientConfigurations;

            _user = context.Users;

            _userClient = context.UserClients;

            _passwordHasher = passwordHasher;

            _configuration = configuration;

            _tenantConfig = tenantConfig.Value;

            _hostingEnvironment = hostingEnvironment;

            _proxyService = proxyService;

            _distributedCache = distributedCache;
        }
 public GraphQLHttpMiddleware(ILogger <GraphQLHttpMiddleware <TSchema> > logger, RequestDelegate next, PathString path,
                              IDistributedCacheService distributedCache)
 {
     _logger           = logger;
     _next             = next;
     _path             = path;
     _distributedCache = distributedCache;
 }
Пример #6
0
        public CacheBuilder WithRedisConfiguration(RedisConfiguration configuration)
        {
            var config = RedisConfigurationHelper.RedisConfigurationMapping(configuration);

            _distributedCacheService = new RedisCacheService(ConnectionMultiplexer.Connect(config));

            return(this);
        }
        public DistributedCacheServiceTests(TestFunctionsFixture testFunctions)
        {
            _testFunctions = testFunctions;

            var options = new OptionsWrapper <MemoryDistributedCacheOptions>(new MemoryDistributedCacheOptions());

            _memoryDistributedCache  = new MemoryDistributedCache(options);
            _distributedCacheService = new DistributedCacheService(_memoryDistributedCache);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ProductsService"/> class.
        /// </summary>
        /// <param name="httpClientFactory">The HTTP Client factory.</param>
        /// <param name="applicationSettings">The application settings.</param>
        /// <param name="autoMapper">The mapper.</param>
        /// <param name="cacheService">cache service.</param>
        public ProductsService(IHttpClientFactory httpClientFactory, IOptions <ApplicationSettings> applicationSettings, IMapper autoMapper, IDistributedCacheService cacheService)
        {
            NotNullValidator.ThrowIfNull(applicationSettings, nameof(applicationSettings));
            IHttpClientFactory httpclientFactory = httpClientFactory;

            this.applicationSettings = applicationSettings;
            this.httpClient          = httpclientFactory.CreateClient();
            this.autoMapper          = autoMapper;
            this.cacheService        = cacheService;
        }
        public TenantFactory(IDistributedCacheService distributedCache,
                             IConfiguration configuration,
                             IOptions <TenantConfig> tenantConfig,
                             IPasswordHasher <User> passwordHasher)
        {
            _distributedCache = distributedCache;

            _configuration = configuration;

            dbContextOptionsBuilders = new ConcurrentDictionary <string, DbContextOptionsBuilder <DbContextDefault> >();

            _tenantConfig = tenantConfig.Value;

            _passwordHasher = passwordHasher;
        }
Пример #10
0
 public WeatherForecastService(IDistributedCacheService distributedCacheService)
 {
     _distributedCacheService = distributedCacheService;
 }
Пример #11
0
 /// <summary>
 /// Creates a DistributedCacheEntryOptions set to expire on a given timespan from now
 /// </summary>
 /// <param name="distributedCacheService">Not used only present to bring the extension method in an easy place</param>
 /// <param name="cacheTime">The time from now the cache time will expire</param>
 /// <returns></returns>
 public static DistributedCacheEntryOptions AbsoluteExpirationOption(this IDistributedCacheService _, TimeSpan cacheTime)
 {
     return(new DistributedCacheEntryOptions().SetAbsoluteExpiration(cacheTime));
 }
Пример #12
0
 public DrawingService(IDrawingRepository drawingRepository, IDistributedCacheService distributedCacheService)
 {
     _drawingRepository       = drawingRepository;
     _distributedCacheService = distributedCacheService;
 }
Пример #13
0
 public CatalogController(IMediator mediator, IDistributedCacheService cacheService, ILogger <CatalogController> logger)
 {
     _mediator     = mediator;
     _cacheService = cacheService;
     _logger       = logger;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DistributedCacheFilter"/> class.
 /// </summary>
 /// <param name="cache">The cache.</param>
 /// <param name="expirationTime">The expiration time.</param>
 public DistributedCacheFilter(IDistributedCacheService cache, TimeSpan expirationTime)
 {
     this.cache = cache;
     this.expirationTime = expirationTime;
 }
Пример #15
0
 public CacheService(IMemoryCacheService memoryCache, IDistributedCacheService distributedCache)
 {
     this.memoryCache      = memoryCache;
     this.distributedCache = distributedCache;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="DistributedCacheFilter"/> class.
 /// </summary>
 /// <param name="cache">The cache.</param>
 /// <param name="expirationTime">The expiration time.</param>
 public DistributedCacheFilter(IDistributedCacheService cache, TimeSpan expirationTime)
 {
     this.cache          = cache;
     this.expirationTime = expirationTime;
 }
Пример #17
0
 public UserDiklzInfoService(ISecurityDbContext dbcontext, IDistributedCacheService cacheService, IHttpContextAccessor httpContextAccessor, IConfiguration confguration)
     : base(dbcontext, cacheService, httpContextAccessor, confguration)
 {
 }
Пример #18
0
 public void SetCache(IDistributedCacheService cache)
 {
     _cache = cache;
 }
 public BatchAcceptedStudents(IDistributedCacheService cacheService)
 {
     _cacheService = cacheService;
 }
Пример #20
0
 public EntityStateHelper(ICommonDataService dataService, IDistributedCacheService cacheService)
 {
     DataService  = dataService;
     CacheService = cacheService;
 }
Пример #21
0
 public StudentInfoAggregator(IDistributedCacheService cacheService, ICoursesService coursesService, IStatisticsService statisticsService)
 {
     _cacheService      = cacheService;
     _coursesService    = coursesService;
     _statisticsService = statisticsService;
 }
Пример #22
0
 public PlayerTransferService(HttpClient httpClient, IDistributedCacheService distributedCacheService)
 {
     _distributedCacheService = distributedCacheService;
     _httpClient = httpClient;
 }
Пример #23
0
 public HomeController(IPieRepository pieRepository, ILogger <HomeController> logger, IDistributedCacheService distributedCacheService)
 {
     _pieRepository           = pieRepository;
     _logger                  = logger;
     _distributedCacheService = distributedCacheService;
 }
Пример #24
0
 public DistributedCacheServiceTests(TestFunctionsFixture testFunctions)
 {
     _testFunctions           = testFunctions;
     _memoryDistributedCache  = new MemoryDistributedCache(new MemoryCache(new MemoryCacheOptions()));
     _distributedCacheService = new DistributedCacheService(_memoryDistributedCache);
 }