Skip to content

Instantly share code, notes, and snippets.

@dieseltravis
Created July 16, 2019 22:02
Show Gist options
  • Select an option

  • Save dieseltravis/acb5c5ce6df7eadcfa21761754639e45 to your computer and use it in GitHub Desktop.

Select an option

Save dieseltravis/acb5c5ce6df7eadcfa21761754639e45 to your computer and use it in GitHub Desktop.
GetJson
//using Newtonsoft.Json;
//private const bool FORMAT_JSON = true;
private static string GetJson(object convertToJson)
{
string serial = JsonConvert.SerializeObject(convertToJson, FORMAT_JSON ? Formatting.Indented : Formatting.None);
return serial;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment