Share via


DiscriminatedTypeJsonConverter<TBase> Constructors

Definition

Overloads

DiscriminatedTypeJsonConverter<TBase>()

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using '$rpctype' for the name of the property that stores the type discriminator value.

Failures in type discrimation will throw.

TBase must be a concrete type. To use an abstract type for TBase use either the overload DiscriminatedTypeJsonConverter<TBase>(Type) or DiscriminatedTypeJsonConverter<TBase>(Type, String).

DiscriminatedTypeJsonConverter<TBase>(Boolean)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using '$rpctype' for the name of the property that stores the type discriminator value.

DiscriminatedTypeJsonConverter<TBase>(String)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using TBase as the fallback type.

DiscriminatedTypeJsonConverter<TBase>(Type)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using '$rpctype' for the name of the property that stores the type discriminator value.

DiscriminatedTypeJsonConverter<TBase>(Boolean, String)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using '$rpctype' for the name of the property that stores the type discriminator value.

DiscriminatedTypeJsonConverter<TBase>(Type, String)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class.

DiscriminatedTypeJsonConverter<TBase>()

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using '$rpctype' for the name of the property that stores the type discriminator value.

Failures in type discrimation will throw.

TBase must be a concrete type. To use an abstract type for TBase use either the overload DiscriminatedTypeJsonConverter<TBase>(Type) or DiscriminatedTypeJsonConverter<TBase>(Type, String).

public:
 DiscriminatedTypeJsonConverter();
public DiscriminatedTypeJsonConverter ();
Public Sub New ()

Applies to

DiscriminatedTypeJsonConverter<TBase>(Boolean)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using '$rpctype' for the name of the property that stores the type discriminator value.

public:
 DiscriminatedTypeJsonConverter(bool useNullInsteadOfBaseType);
public DiscriminatedTypeJsonConverter (bool useNullInsteadOfBaseType);
new Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)> : bool -> Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)>
Public Sub New (useNullInsteadOfBaseType As Boolean)

Parameters

useNullInsteadOfBaseType
Boolean

Whether the converter should return null as the fallback value instead of the TBase.

Applies to

DiscriminatedTypeJsonConverter<TBase>(String)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using TBase as the fallback type.

public:
 DiscriminatedTypeJsonConverter(System::String ^ jsonPropertyName);
public DiscriminatedTypeJsonConverter (string jsonPropertyName);
new Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)> : string -> Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)>
Public Sub New (jsonPropertyName As String)

Parameters

jsonPropertyName
String

The name of the json property used to hold the type discriminator value.

Applies to

DiscriminatedTypeJsonConverter<TBase>(Type)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using '$rpctype' for the name of the property that stores the type discriminator value.

public:
 DiscriminatedTypeJsonConverter(Type ^ fallbackType);
public DiscriminatedTypeJsonConverter (Type fallbackType);
new Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)> : Type -> Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)>
Public Sub New (fallbackType As Type)

Parameters

fallbackType
Type

A type used as a fallback value when type discrimination fails. Failures can occur when the type disciminator value is null, not a string, or does not correspond to a known type.

Applies to

DiscriminatedTypeJsonConverter<TBase>(Boolean, String)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class, using '$rpctype' for the name of the property that stores the type discriminator value.

public:
 DiscriminatedTypeJsonConverter(bool useNullInsteadOfBaseType, System::String ^ jsonPropertyName);
public DiscriminatedTypeJsonConverter (bool useNullInsteadOfBaseType, string jsonPropertyName);
new Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)> : bool * string -> Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)>
Public Sub New (useNullInsteadOfBaseType As Boolean, jsonPropertyName As String)

Parameters

useNullInsteadOfBaseType
Boolean

Whether the converter should return null as the fallback value instead of the TBase.

jsonPropertyName
String

The name of the json property used to hold the type discriminator value.

Applies to

DiscriminatedTypeJsonConverter<TBase>(Type, String)

Initializes a new instance of the DiscriminatedTypeJsonConverter<TBase> class.

public:
 DiscriminatedTypeJsonConverter(Type ^ fallbackType, System::String ^ jsonPropertyName);
public DiscriminatedTypeJsonConverter (Type fallbackType, string jsonPropertyName);
new Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)> : Type * string -> Microsoft.VisualStudio.RpcContracts.JsonConverters.DiscriminatedTypeJsonConverter<'Base (requires 'Base : null)>
Public Sub New (fallbackType As Type, jsonPropertyName As String)

Parameters

fallbackType
Type

A type used as a fallback value when type discrimination fails. Failures can occur when the type disciminator value is null, not a string, or does not correspond to a known type.

Pass null to have the converter return null when type discrimination fails.

jsonPropertyName
String

The name of the json property used to hold the type discriminator value.

Applies to