using System.Collections.Generic;
using Newtonsoft.Json.Linq;
public static void Main()
Account account = new Account
Email = "james@example.com",
CreatedDate = new DateTime(2013, 1, 20, 0, 0, 0, DateTimeKind.Utc),
Roles = new List<string> { "User", "Admin" }
string json = JsonConvert.SerializeObject(account);
var jObj = JObject.Parse(json);
Console.WriteLine(jObj.ToString());
public string Email { get; set; }
public bool Active { get; set; }
public DateTime CreatedDate { get; set; }
public IList<string> Roles { get; set; }