Deserialize json array with System.Text.Json

Json Data

[
  {
    "FirstName": "Brick",
    "LastName": "Heck"
  },
  {
    "FirstName": "Sue Sue",
    "LastName": "Heck"
  }
]

And the class and method for deserialization

     public class Dto {
	public string FirstName { get;	set;}
	public string LastName {	get;	set;}
}
// Deserializer method
public static IList < Dto > DeserializeSystemNotificationEmail(string json) {
	var options = new JsonSerializerOptions {
		AllowTrailingCommas = true,
		PropertyNameCaseInsensitive = true
	};

	return JsonSerializer.Deserialize <IList<Dto>> (json, options);
}

A post about the performance of system.text.json

#json #System.Text.Json #net-core #dotnet