JsonValue.TryGetValue<T>(T) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Tries to obtain the current JSON value and returns a value that indicates whether the operation succeeded.
public:
generic <typename T>
abstract bool TryGetValue([Runtime::InteropServices::Out] T % value);
public abstract bool TryGetValue<T> (out T? value);
abstract member TryGetValue : 'T -> bool
Public MustOverride Function TryGetValue(Of T) (ByRef value As T) As Boolean
Type Parameters
- T
The type of value to obtain.
Parameters
- value
- T
When this method returns, contains the parsed value.
Returns
true
if the value can be successfully obtained; otherwise, false
.
Remarks
{T} can be the type or base type of the underlying value. If the underlying value is a JsonElement, then {T} can also be the type of any primitive value supported by current JsonElement.
Specifying the Object type for {T} will always succeed and return the underlying value as Object.
The underlying value of a JsonValue after deserialization is an instance of JsonElement, otherwise it's the value specified when the JsonValue was created.
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈