Files
zszq-trs/Framework/YLErp.Cache/CacheModule.cs
T
2024-05-22 13:35:57 +08:00

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);
}
}
}