public static IServiceCollection AddSleepySharkCaching(this IServiceCollection services, Action <SleepySharkCachingOptions> setupAction) { if (setupAction == null) { throw new ArgumentNullException(); } var options = new SleepySharkCachingOptions(); setupAction(options); foreach (var serviceExtension in options.Extensions) { serviceExtension.AddServices(services); } services.AddSingleton(options); return(services); }
public static SleepySharkCachingOptions UserInMemoryCache(this SleepySharkCachingOptions options, string name = _name) { options.RegisterExtension(new InMemoryCacheOptionExtensions(name)); return(options); }