public static void Main()
string charCollection = "4352";
string plainString = Newtonsoft.Json.JsonConvert.SerializeObject(charCollection);
Console.WriteLine(charCollection);
string stringObject = "{\"MyInt\":23}";
string jsonRepresentation = Newtonsoft.Json.JsonConvert.SerializeObject(stringObject);
Console.WriteLine(jsonRepresentation);
var deserializedString = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(jsonRepresentation);
Console.WriteLine(deserializedString);
var dictionary = new System.Collections.Generic.Dictionary<string,string>();
var serializedObject = Newtonsoft.Json.JsonConvert.SerializeObject(new MyObject{MyInt = 23});
Console.WriteLine(serializedObject);
dictionary.Add("wrapped-cache-key", "\""+serializedObject+"\"");
dictionary.Add("cache-key", serializedObject);
var fromCachedObject = dictionary["cache-key"];
var deserializedObject = Newtonsoft.Json.JsonConvert.DeserializeObject<MyObject>(fromCachedObject);
Console.WriteLine(deserializedObject);
Console.WriteLine("\n\n========================================");
Console.WriteLine("*\r PROBLEMATIC AREA *");
Console.WriteLine("========================================\n\n");
var fromCacheWithoutQuotes = dictionary["cache-key"];
Console.WriteLine(fromCacheWithoutQuotes);
var deserializedObjectWithoutQuotes = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(fromCacheWithoutQuotes);
Console.WriteLine(deserializedObjectWithoutQuotes);
var fromCacheWithQuotes = dictionary["wrapped-cache-key"];
Console.WriteLine(fromCacheWithQuotes);
var deserializedObjectWithQuotes = Newtonsoft.Json.JsonConvert.DeserializeObject<string>(fromCacheWithQuotes.ToString());
Console.WriteLine(deserializedObjectWithQuotes);
public int MyInt {get; set;}