using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Runtime.Serialization;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
namespace Question42177475
public int ID { get; set; }
public string Reference { get; set; }
public int Asset { get; set; }
public int Event { get; set; }
public string DateEventStart { get; set; }
public string DateEvent { get; set; }
public class RootObject<T>
public int Code { get; set; }
public T Result { get; set; }
""DateEventStart"": ""2/10/2017 9:08:33 PM"",
""DateEvent"": ""2/11/2017 1:00:14 AM""
internal static void Test()
var responsetext = GetJson();
var rootOfList = JsonConvert.DeserializeObject<RootObject<List<Result>>>(responsetext);
var rootOfTable = JsonConvert.DeserializeObject<RootObject<DataTable>>(responsetext);
DataTable table = rootOfTable.Result;
Console.WriteLine(string.Format("Result of deserializing and reserializing as a {0}:", rootOfList.GetType()));
Console.WriteLine(JsonConvert.SerializeObject(rootOfList, Newtonsoft.Json.Formatting.Indented));
Console.WriteLine(string.Format("Result of deserializing and reserializing as a {0}:", rootOfTable.GetType()));
Console.WriteLine(JsonConvert.SerializeObject(rootOfTable, Newtonsoft.Json.Formatting.Indented));
public static void Main()
Console.WriteLine("Json.NET version: " + typeof(JsonSerializer).Assembly.FullName);
Question42177475.TestClass.Test();