Skip to content

Commit

Permalink
revert #487
Browse files Browse the repository at this point in the history
Signed-off-by: catcherwong <[email protected]>
  • Loading branch information
catcherwong committed Nov 13, 2023
1 parent c627d78 commit f33a7db
Showing 1 changed file with 0 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,38 +30,5 @@ public static IServiceCollection AddEasyCaching(this IServiceCollection services

return services;
}

/// <summary>
/// Adds the EasyCaching.
/// </summary>
/// <returns>The easy caching.</returns>
/// <param name="services">Services.</param>
/// <param name="setupAction">Setup action.</param>
public static IServiceCollection AddEasyCaching(this IServiceCollection services, Action<IServiceProvider, EasyCachingOptions> setupAction)
{
ArgumentCheck.NotNull(setupAction, nameof(setupAction));

// Options
services.AddSingleton(sp =>
{
var options = new EasyCachingOptions();
setupAction(sp, options);
return options;
});

// Extension services
services.AddSingleton(sp =>
{
var options = sp.GetRequiredService<EasyCachingOptions>();
foreach (var serviceExtension in options.Extensions)
{
serviceExtension.AddServices(services);
}
return options;
});

return services;
}
}
}

0 comments on commit f33a7db

Please sign in to comment.