2023-01-11 18:16:58 +08:00
|
|
|
|
using Microsoft.AspNetCore.Builder;
|
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
|
using StartupModules;
|
2023-01-17 17:50:15 +08:00
|
|
|
|
using Yi.Framework.Core;
|
|
|
|
|
|
using Yi.Framework.Core.Attributes;
|
2023-01-11 18:16:58 +08:00
|
|
|
|
using Yi.Framework.Core.Configuration;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Yi.Framework.Caching.Redis
|
|
|
|
|
|
{
|
2023-01-17 17:50:15 +08:00
|
|
|
|
[DependsOn(
|
|
|
|
|
|
typeof(YiFrameworkCoreModule)
|
|
|
|
|
|
)]
|
2023-01-11 18:16:58 +08:00
|
|
|
|
public class YiFrameworkCachingRedisModule : IStartupModule
|
|
|
|
|
|
{
|
|
|
|
|
|
public void Configure(IApplicationBuilder app, ConfigureMiddlewareContext context)
|
|
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void ConfigureServices(IServiceCollection services, ConfigureServicesContext context)
|
|
|
|
|
|
{
|
|
|
|
|
|
services.Configure<CachingConnOptions>(Appsettings.appConfiguration("CachingConnOptions"));
|
2023-01-16 23:05:01 +08:00
|
|
|
|
services.AddSingleton<CacheManager, RedisCacheClient>();
|
2023-01-11 18:16:58 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|