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.
25 lines
589 B
C#
25 lines
589 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);
|
|
}
|
|
}
|
|
}
|