Skip to content

Instantly share code, notes, and snippets.

@edqwerty1
Created June 7, 2019 13:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edqwerty1/cc0cad485356c233284d6391dfd73843 to your computer and use it in GitHub Desktop.
Save edqwerty1/cc0cad485356c233284d6391dfd73843 to your computer and use it in GitHub Desktop.
public static class WebApiHelpers
{
public static string ToJson(Object model)
{
var serializerSettings = new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
};
return JsonConvert.SerializeObject(model, serializerSettings);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment