Redigera

Dela via


JsonSerializerOptions.GetConverter(Type) Method

Definition

Returns the converter for the specified type.

public:
 System::Text::Json::Serialization::JsonConverter ^ GetConverter(Type ^ typeToConvert);
public System.Text.Json.Serialization.JsonConverter GetConverter (Type typeToConvert);
member this.GetConverter : Type -> System.Text.Json.Serialization.JsonConverter
Public Function GetConverter (typeToConvert As Type) As JsonConverter

Parameters

typeToConvert
Type

The type to return a converter for.

Returns

The first converter that supports the given type.

Exceptions

The configured JsonConverter for typeToConvert returned an invalid converter.

There is no compatible JsonConverter for typeToConvert or its serializable members.

Remarks

For more information, see How to write custom converters for JSON serialization (marshalling) in .NET.

Applies to