I'm trying to find out how QuickType.io works, however I cannot find a way to show my converted results.
I converted a JSON file to C# and got a satisfactory output:
public partial class Welcome
{
[JsonProperty("relatiesoort")]
public string[] Relatiesoort { get; set; }
[JsonProperty("modifiedOn")]
public DateTimeOffset ModifiedOn { get; set; }
[JsonProperty("relatiecode")]
public long Relatiecode { get; set; }
[JsonProperty("naam")]
public string Naam { get; set; }
}
I think the Welcome class can be used to do what I want:
public partial class Welcome
{
public static Welcome[] FromJson(string json) => JsonConvert.DeserializeObject<Welcome[]>(json, APIconnectV2.JSON.Converter.Settings);
}
This is the code I use to print the results:
var result = httpClient.GetAsync(new Uri("http://hidden.com')")).Result;
var json = result.Content.ReadAsStringAsync().Result;
dynamic jObject = JArray.Parse(json);
System.Diagnostics.Debug.WriteLine(Welcome.FromJson(json)[0]);
However, the output I receive is:
APIconnectV2.JSON.Welcome
Any number greater than 0 results in an out of bounds error. I'm not even sure if this is the correct way to print my output, however I cannot find a lot of documentation surrounding QuickType.