using System.Text.Json.Serialization;
using System.Collections.Generic;
private static string jsonLiteral = "{ \"MyArray\": [\"Ford\", \"BMW\", \"Fiat\"] }";
public static void Main()
var myDeserializedClass = JsonSerializer.Deserialize<Root>(jsonLiteral);
Console.WriteLine(myDeserializedClass.MyArray.Count);
Console.WriteLine("Well, that didn't work. Let's try something else.");
var myDeserializedClass = JsonSerializer.Deserialize<string[]>(jsonLiteral);
Console.WriteLine(myDeserializedClass.Length);
Console.WriteLine("Well, that didn't work. Let's try something else.");
[JsonPropertyName("MyArray")]
public List<string> MyArray { get; set; }