Hi,
having an object declared like this
public class CacheEntry
{
public DateTime CreatedOn { get; set; }
public string CacheKey { get; set; }
public object CachedObject { get; set; }
}
It is serialized in redis using :
_cacheClient.Set(cacheKey,value,new TimeSpan(0,0, expiresInSeconds));
In redis it stored like that :
{
“CreatedOn”: “2016-09-12T08:22:37.8215667Z”,
“CacheKey”: “GetCompetitionTypes”,
“CachedObject”: [
{
"__type": “SDR.DataModel.Competition.Raw.CompetitionType, SDR.DataModel”,
“ID”: -3,
“Code”: “EURO”,
“Name”: “European Championship”,
“ShortName”: “EURO”,
“ActiveSeason”: 2016,
“IsTeamCompetition”: true,
“Competitions”: [],
“Languages”: [],
“DataCoverage”: “All”,
“LiveSource”: “CDWS”,
“StatsSource”: “CDWS”
},
{
“ID”: 3,
“Code”: “EURO”,
“Name”: “European Championship”,
“ShortName”: “EURO”,
“ActiveSeason”: 2016,
“IsTeamCompetition”: true,
“Competitions”: [],
“Languages”: [],
“DataCoverage”: “All”,
“LiveSource”: “CDWS”,
“StatsSource”: “CDWS”
}, … etc …
When I tr to get it back
return _cacheClient.Get(cacheKey);
the CachedObject property is a plain string containing what has been stored in redis … seems the __type hint on (only) the first item of the list is not “enough” to deserialize the object back in the proper way.
What could be the problem ?
thank you
enrico