classes to json newtonsoft code example Example: newtonsoft json object to json string string output = JsonConvert.SerializeObject(product);