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
613 B
C#

using FreeRedis;
using Newtonsoft.Json;
using RoBot.Core.Helper;
namespace RoBot.Core.Redis
{
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);
}
}
}