string json = JsonConvert.SerializeObject(o); using System.Web.Http; string json = JsonConvert.SerializeObject(o);