You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

14 lines
382B

  1. using Newtonsoft.Json;
  2. namespace HealthMonitor.WebApi.Extensions
  3. {
  4. public static class ObjectJsonConvertExt
  5. {
  6. public static string ToJson(this object target)
  7. {
  8. var jsonSetting = new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore };
  9. return JsonConvert.SerializeObject(target, jsonSetting);
  10. }
  11. }
  12. }