22 lines
547 B
C#
22 lines
547 B
C#
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace YLErp.Cache
|
|
{
|
|
public class CacheModule
|
|
{
|
|
public static void InitModule(IServiceCollection services)
|
|
{
|
|
services.AddYLCache(option => { });
|
|
}
|
|
}
|
|
|
|
public static class CacheServiceExtensions
|
|
{
|
|
public static void AddYLCache(this IServiceCollection services, Action<CacheConfig> optionAction)
|
|
{
|
|
services.AddTransient<IYLCache, YLRedisCache>();
|
|
services.Configure(optionAction);
|
|
}
|
|
}
|
|
}
|