I'm having a problem storing an object containing a dictionary using ServiceStack.Redis. The object that I'm trying to store is defined as below:
public class Feed
{
public Guid ID { get; set; }
public String Title { get; set; }
public String Description { get; set; }
public Object Details { get; set; }
public Int32 SortOrder { get; set; }
public Image Picture { get; set; }
public String FeedType { get; set; }
public long ArticleCount { get; set; }
public String ParentTheme { get; set; }
public Guid ParentThemeID { get; set; }
public Boolean IsFavourite { get; set; }
public Boolean? Hidden { get; set; }
public Dictionary<String, String> ExtendedProperties { get; set; }
}
Although most of the object gets serialised correctly, but the Dictionary property (ExtendedProperties) does not get serialised.
I have tried setting JsConfig.IncludePublicFields = true but it doesn't seem to make any difference.
What is most confusing me is that it would seem that the dictionary is serialised some of the time (mostly when I'm stepping through the code in the debugger it seems) but not reproducibly.
Does anyone have any suggestions as to how I can get the dictionary to be successfully serialised (beyond using Newtonsoft.Json to serialize the object to a staring, and then storing that directing in Redis)
Many Thanks,
Richard.