-
Notifications
You must be signed in to change notification settings - Fork 333
Closed
Description
I was trying to use JSON serialization instead (as mentioned here: #253). But it throws an exception like: InvalidOperationException: Sequence contains no matching element
.
This is my setup:
services.AddEasyCaching(option =>
{
option.UseInMemory("Memory");
option.WithJson("JsonSerialization"); // Store as JSON, so we don't need to mark everything with [Serializable]
// distributed
option.UseRedis(config =>
{
config.DBConfig.Endpoints.Add(new ServerEndPoint("127.0.0.1", 6379));
config.SerializerName = "JsonSerialization";
//config.DBConfig.Database = 5;
}, "Redis");
// combine local and distributed
option.UseHybrid(config =>
{
config.TopicName = "test-topic";
config.EnableLogging = true;
// specify the local cache provider name after v0.5.4
config.LocalCacheProviderName = "Memory";
// specify the distributed cache provider name after v0.5.4
config.DistributedCacheProviderName = "Redis";
}, "Hybrid")
.WithRedisBus(busConf =>
{
busConf.Endpoints.Add(new ServerEndPoint("127.0.0.1", 6380));
});
});
It works perfectly if I don't have the WithJson("JsonSerialization")
and config.SerializerName = "JsonSerialization"
.