using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public string room_id { get; set; }
public string room_name { get; set; }
public string booking_label { get; set; }
public DateTime booking_start { get; set; }
public DateTime booking_end { get; set; }
public DateTime booking_created { get; set; }
public static void Test()
var jsonResult = GetJson();
var reservations = Newtonsoft.Json.JsonConvert.DeserializeAnonymousType(jsonResult,
new { bookings = new { group_id = "", name = "", url="", timeslots = new List<Timeslot>() } });
Console.WriteLine("Populated reservations: ");
Console.WriteLine(JsonConvert.SerializeObject(reservations, Formatting.Indented));
Assert.IsTrue(reservations.bookings.group_id == (string)JToken.Parse(jsonResult).SelectToken("bookings.group_id"));
Assert.IsTrue(reservations.bookings.name == (string)JToken.Parse(jsonResult).SelectToken("bookings.name"));
Assert.IsTrue(reservations.bookings.url == (string)JToken.Parse(jsonResult).SelectToken("bookings.url"));
""Information"": ""Weekly Prices"",
""Time Zone"": ""US/Eastern""
""volume"": ""112414465""
""volume"": ""170037931""
public static void Main()
Console.WriteLine("Environment version: " + Environment.Version);
Console.WriteLine("Json.NET version: " + typeof(JsonSerializer).Assembly.FullName);
Console.WriteLine("Failed with unhandled exception: ");