JsonSerializerOptions.GetTypeInfo(Type) Method
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.
Gets the JsonTypeInfo contract metadata resolved by the current JsonSerializerOptions instance.
public:
System::Text::Json::Serialization::Metadata::JsonTypeInfo ^ GetTypeInfo(Type ^ type);
public System.Text.Json.Serialization.Metadata.JsonTypeInfo GetTypeInfo(Type type);
member this.GetTypeInfo : Type -> System.Text.Json.Serialization.Metadata.JsonTypeInfo
Public Function GetTypeInfo (type As Type) As JsonTypeInfo
- type
- Type
The type to resolve contract metadata for.
The contract metadata resolved for type
.
type
is null
.
type
is not valid for serialization.
Returned metadata can be downcast to JsonTypeInfo<T> and used with the relevant JsonSerializer overloads.
If the JsonSerializerOptions instance is locked for modification, the method returns a cached instance for the metadata.
Product | Versions |
---|---|
.NET | 7, 8 (package-provided), 8, 9 (package-provided), 9, 10 (package-provided), 10 |
.NET Standard | 2.0 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: