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); }
public DiskCacheService(DiskCacheOptions options, ILogger logger) { this.options = options; cache = new ClassicDiskCache(options, logger); this.logger = logger; }