using System.Collections.Generic;
public string FirstName { get; set; }
public string LastName { get; set; }
public bool IsManager { get; set; }
public DateTime JoinedDate { get; set; }
public List<string> Titles { get; set; }
public static void Main()
var fileName = "books.xml";
Employee employee = new Employee
JoinedDate = new DateTime(2013, 1, 20, 0, 0, 0, DateTimeKind.Utc),
Titles = new List<string>
string json = JsonConvert.SerializeObject(employee, Formatting.Indented);
WriteFile(fileName, json);
var s = ReadAllText(fileName);
public static void WriteFile(string path, string content)
File.WriteAllText(path, content);
public static string ReadAllText(string path)
return File.ReadAllText(path);