123456789101112131415161718192021222324 |
- using ERP.Framework.Cache;
- using ERP.Framework.Config;
- using Microsoft.Extensions.DependencyInjection;
- namespace ERP.Framework.Extensions
- {
- public static class CacheExtension
- {
- /// <summary>
- ///
- /// </summary>
- /// <param name="services"></param>
- /// <param name="config"></param>
- /// <returns></returns>
- public static void AddCache(this IServiceCollection services, RedisConfig config)
- {
- // 内存缓存 如有需要再做处理
- services.AddMemoryCache();
- // 初始化Redis
- RedisHelper.Init(config);
- }
- }
- }
|