Skip to content

Instantly share code, notes, and snippets.

@jskeet
Created March 24, 2023 10:33
Show Gist options
  • Save jskeet/08e6c670dc2998c2bc58bc2f7e6eb9b0 to your computer and use it in GitHub Desktop.
Save jskeet/08e6c670dc2998c2bc58bc2f7e6eb9b0 to your computer and use it in GitHub Desktop.
using Q75832457;
using System.Text.Json;
JsonSerializerOptions JsonSerializerOptions = new()
{
PropertyNameCaseInsensitive = true
};
string json = @"
[
{
""rawMessage"": ""adsfasf a\u00F6dsij\u00F6oi \u00F6jadf"",
""dateTime"": ""2023-03-24T10:04:05.6560707+01:00"",
""senderCompId"": ""BB"",
""targetCompId"": ""PRIOR"",
""targetSubId"": ""EMSX"",
""sent"": false
}
]";
List<Message> messages = JsonSerializer.Deserialize<List<Message>>(json, JsonSerializerOptions);
Console.WriteLine(messages.Count); // Prints 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment