-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Text.Json
Milestone
Description
RE: dotnet/aspnetcore#7105 (comment)
Newtonsoft JObject .Value<string>(propertyName);
as a convenient way to find a property and extract the value in a single operation. Note this returns null of the property isn't found. It also type converts the various datatypes to strings if that's the T you requested.
The equivalent code for JsonDocument looks something like this:
document.RootElement.TryGetProperty(key, out var value) ? value.ToString() : null;
ahsonkhan and darkflame0
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Text.Json