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

26 lines
641 B
C#

using FreeRedis;
using Newtonsoft.Json;
namespace RoBot.Core.Helper
{
public class RedisHelper
{
/// <summary>
/// Redis客户端
/// </summary>
public static RedisClient Client;
public RedisHelper()
{
string con = AppConfigHelper.Get("ConnectionStrings:Redis");
Client = new(con)
{
Serialize = JsonConvert.SerializeObject,
Deserialize = JsonConvert.DeserializeObject
};
Client.Set(Guid.NewGuid().ToString(), "", 10);
Console.WriteLine("初始化Redis...");
}
}
}