Camera Information System
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

20 lines
491 B

using FreeRedis;
namespace Cis.Core;
public static class CacheSetup
{
/// <summary>
/// Redis 缓存注册
/// </summary>
/// <param name="services"></param>
public static void AddCache(this IServiceCollection services)
{
services.AddSingleton<RedisClient>(options =>
{
var redisOptions = App.GetOptions<RedisOptions>();
RedisClient cache = new(redisOptions.ConnectionString);
return cache;
});
}
}