using System.Collections.Generic;
public static void Main()
StartDate = DateTime.Parse("1/2/2011"),
Students = new List<Student>
new Student { Name = "John", Age = 14, EnrollmentDate = DateTime.Parse("2/1/2019") },
new Student { Name = "Mark", Age = 13, EnrollmentDate = DateTime.Parse("1/21/2019") },
var sCourse = "{\"Title\":\"Biology 101\",\"StartDate\":\"2011-01-02T00:00:00\",\"Students\":[{\"Name\":\"John\",\"Age\":14,\"EnrollmentDate\":\"2019-02-01T00:00:00\"},{\"Name\":\"Mark\",\"Age\":13,\"EnrollmentDate\":\"2019-01-21T00:00:00\"}]}";
var json = Newtonsoft.Json.JsonConvert.SerializeObject(course);
var o = Newtonsoft.Json.JsonConvert.DeserializeObject<Course>(sCourse);
Console.WriteLine(o.Title);
json = Newtonsoft.Json.JsonConvert.SerializeObject(course,Newtonsoft.Json.Formatting.Indented);
public string Name { get; set; }
public int Age { get; set; }
public DateTime EnrollmentDate { get; set; }
public string Title { get; set; }
public DateTime StartDate { get; set; }
public List<Student> Students { get; set; }