using System.Collections.Generic;
static string fakeJsonString =
@"{ ""text"": ""This is a text"", ""intValue"": 10, ""dictionary"": { ""key"": ""value"" }, ""array"": [ 10, 20, 30 ] }";
internal class FakeObject {
public string Text { get;set; }
[JsonProperty("intValue")]
public int IntValue { get;set; }
[JsonProperty("dictionary")]
public Dictionary<string, string> Dictionary { get;set; }
public int[] IntArray { get;set; }
public static void Main()
var fakeObject = JsonConvert.DeserializeObject<FakeObject>( fakeJsonString );
Console.WriteLine("Current value for text: " + fakeObject.Text);
Console.WriteLine("Current value for intValue: " + fakeObject.IntValue);
Console.WriteLine("Current value for Dictionary: " + string.Join( ",", fakeObject.Dictionary.Select(kvp => "\"" + kvp.Key + "\": \"" + kvp.Value + "\"" ) ) );
Console.WriteLine("Current value for IntArray: " + string.Join( ",", fakeObject.IntArray));