예제 #1
0
        public static IServiceCollection AddImageflowDiskCache(this IServiceCollection services, DiskCacheOptions options)
        {
            services.AddSingleton <IClassicDiskCache>((container) =>
            {
                var logger = container.GetRequiredService <ILogger <DiskCacheService> >();
                return(new DiskCacheService(options, logger));
            });



            services.AddHostedService <DiskCacheHostedServiceProxy>();
            return(services);
        }
예제 #2
0
 public DiskCacheService(DiskCacheOptions options, ILogger logger)
 {
     this.options = options;
     cache        = new ClassicDiskCache(options, logger);
     this.logger  = logger;
 }