I use Redis Desktop Manager in windows 10 for caching in ASP.Net Core 3.1 by StackExchange.Redis library.
Except delete and then again add new Key-Value in Redis, is there any way for updating value by key?
I use Redis Desktop Manager in windows 10 for caching in ASP.Net Core 3.1 by StackExchange.Redis library.
Except delete and then again add new Key-Value in Redis, is there any way for updating value by key?
using (ConnectionMultiplexer redis = ConnectionMultiplexer.Connect(""))
{
IDatabase db = redis.GetDatabase();
string age = "11";
db.StringSet("age", age);
}
you want to update "age" 25,you can reuse db.StringSet("age", "25");
var content = Encoding.UTF8.GetBytes(JsonSerializer.Serialize(dto));
await _cache.SetAsync("Key", content);
dto is the value sent by Action