using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Collections.ObjectModel;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public string DisplayName { get; set; }
public string Id { get; set; }
public bool IgnoreCache { get; set; }
public string TenantId { get; set; } = "Default Value";
public static void Test()
var jsonBody = GetJson();
var model = JsonConvert.DeserializeObject<Payload>(jsonBody);
var newJson = JsonConvert.SerializeObject(model, Formatting.Indented);
Console.WriteLine("Re-serialized {0};", model);
Console.WriteLine(newJson);
static string GetJson() => @"{
""displayName"": ""Something"",
public static void Main()
Console.WriteLine("Environment version: {0} ({1})", System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , Environment.Version);
Console.WriteLine("{0} version: {1}", typeof(JsonSerializer).Assembly.GetName().Name, typeof(JsonSerializer).Assembly.FullName);
Console.WriteLine("Failed with unhandled exception: ");