You can also try using
JObject
and access the element via keys. For example:
var data = JObject.Parse("Some Json String");
var elementValue = data["SomeProperty"];
Another approach is using
JsonDocument
. For example:
var jsonDocument = JsonDocument.Parse("Some Json String");
var elementValue = jsonDocument.RootElement.GetProperty("SomeProperty").GetString();
var jsonElement = jsonDocument.RootElement.TryGetProperty("SomeProperty", out var targetElement);
if (!jsonElement)
{
}