Edit

Share via


JsonMetadataServices.GetNullableConverter Method

Definition

Overloads

GetNullableConverter<T>(JsonSerializerOptions)

Creates a JsonConverter<T> instance that converts T?? values.

GetNullableConverter<T>(JsonTypeInfo<T>)

Creates a JsonConverter<T> instance that converts T?? values.

GetNullableConverter<T>(JsonSerializerOptions)

Source:
JsonMetadataServices.Converters.cs
Source:
JsonMetadataServices.Converters.cs
Source:
JsonMetadataServices.Converters.cs

Creates a JsonConverter<T> instance that converts T?? values.

public:
generic <typename T>
 where T : value class static System::Text::Json::Serialization::JsonConverter<Nullable<T>> ^ GetNullableConverter(System::Text::Json::JsonSerializerOptions ^ options);
public static System.Text.Json.Serialization.JsonConverter<T?> GetNullableConverter<T> (System.Text.Json.JsonSerializerOptions options) where T : struct;
static member GetNullableConverter : System.Text.Json.JsonSerializerOptions -> System.Text.Json.Serialization.JsonConverter<Nullable<'T>> (requires 'T : struct)
Public Shared Function GetNullableConverter(Of T As Structure) (options As JsonSerializerOptions) As JsonConverter(Of Nullable(Of T))

Type Parameters

T

The generic definition for the underlying nullable type.

Parameters

options
JsonSerializerOptions

The JsonSerializerOptions to use for serialization and deserialization.

Returns

A JsonConverter<T> instance that converts T?? values

Remarks

This API is for use by the output of the System.Text.Json source generator and should not be called directly.

Applies to

GetNullableConverter<T>(JsonTypeInfo<T>)

Source:
JsonMetadataServices.Converters.cs
Source:
JsonMetadataServices.Converters.cs
Source:
JsonMetadataServices.Converters.cs

Creates a JsonConverter<T> instance that converts T?? values.

public:
generic <typename T>
 where T : value class static System::Text::Json::Serialization::JsonConverter<Nullable<T>> ^ GetNullableConverter(System::Text::Json::Serialization::Metadata::JsonTypeInfo<T> ^ underlyingTypeInfo);
public static System.Text.Json.Serialization.JsonConverter<T?> GetNullableConverter<T> (System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> underlyingTypeInfo) where T : struct;
static member GetNullableConverter : System.Text.Json.Serialization.Metadata.JsonTypeInfo<'T (requires 'T : struct)> -> System.Text.Json.Serialization.JsonConverter<Nullable<'T>> (requires 'T : struct)
Public Shared Function GetNullableConverter(Of T As Structure) (underlyingTypeInfo As JsonTypeInfo(Of T)) As JsonConverter(Of Nullable(Of T))

Type Parameters

T

The generic definition for the underlying nullable type.

Parameters

underlyingTypeInfo
JsonTypeInfo<T>

Serialization metadata for the underlying nullable type.

Returns

A JsonConverter<T> instance that converts T?? values

Remarks

This API is for use by the output of the System.Text.Json source generator and should not be called directly.

Applies to