User-2089506584 posted
Hello,
Why I get this error using Azure Redis Cache (Preview) "Value of type 'System.Collections.Generic.List(Of Person)' cannot be converted to 'StackExchange.Redis.RedisValue'."
[Serializable()]
public class Person
{
private string FirstName;
private string LastName;
}
using StackExchange.Redis;
ConnectionMultiplexer Connection = ConnectionMultiplexer.Connect("website.redis.cache.windows.net,ssl=true,password=...");
IDatabase cache = Connection.GetDatabase();
List<Person> p = new List<Person>();
p.Add(new Person {
FirstName = "Mike",
LastName = "Shourge"
});
p.Add(new Person {
FirstName = "Jenny",
LastName = "Baldwin"
});
cache.StringSet("cacheKey", p.ToList, TimeSpan.FromMinutes(10), When.Always, CommandFlags.None); //<<--Error Here
-imperialx