I’d like to share how to deserialize Dictionary to custom object using Newtonsoft.Json’s JObject class :
private MyCustomObject DeserializeUsingLinqToJson(string documentId)
{
Document document = localDatabase.GetExistingDocument(documentId);
Dictionary<string, object> properties = document.UserProperties;
JObject obj = JObject.FromObject(properties);
return obj.ToObject<MyCustomObject>();
}
Suppose it’s more effective than string-based JSON serialization described here.