JsonStringEnumConverter Classe

Definizione

Converte i valori di enumerazione in e da stringhe.

public ref class JsonStringEnumConverter : System::Text::Json::Serialization::JsonConverterFactory
public ref class JsonStringEnumConverter sealed : System::Text::Json::Serialization::JsonConverterFactory
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JsonStringEnumConverter cannot be statically analyzed and requires runtime code generation. Applications should use the generic JsonStringEnumConverter<TEnum> instead.")]
public class JsonStringEnumConverter : System.Text.Json.Serialization.JsonConverterFactory
public sealed class JsonStringEnumConverter : System.Text.Json.Serialization.JsonConverterFactory
public class JsonStringEnumConverter : System.Text.Json.Serialization.JsonConverterFactory
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JsonStringEnumConverter cannot be statically analyzed and requires runtime code generation. Consider authoring a custom converter that is not a factory to work around the issue. See https://github.com/dotnet/runtime/issues/73124.")]
public class JsonStringEnumConverter : System.Text.Json.Serialization.JsonConverterFactory
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JsonStringEnumConverter cannot be statically analyzed and requires runtime code generation. Applications should use the generic JsonStringEnumConverter<TEnum> instead.")>]
type JsonStringEnumConverter = class
    inherit JsonConverterFactory
type JsonStringEnumConverter = class
    inherit JsonConverterFactory
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JsonStringEnumConverter cannot be statically analyzed and requires runtime code generation. Consider authoring a custom converter that is not a factory to work around the issue. See https://github.com/dotnet/runtime/issues/73124.")>]
type JsonStringEnumConverter = class
    inherit JsonConverterFactory
Public Class JsonStringEnumConverter
Inherits JsonConverterFactory
Public NotInheritable Class JsonStringEnumConverter
Inherits JsonConverterFactory
Ereditarietà
JsonStringEnumConverter
Attributi

Commenti

La lettura non fa distinzione tra maiuscole e minuscole. La scrittura può essere personalizzata usando un oggetto JsonNamingPolicy.

Per altre informazioni, vedere Come personalizzare i nomi e i valori delle proprietà con System.Text.Json.

Costruttori

Nome Descrizione
JsonStringEnumConverter()

Inizializza un'istanza della JsonStringEnumConverter classe con i criteri di denominazione predefiniti che consentono valori interi.

JsonStringEnumConverter(JsonNamingPolicy, Boolean)

Inizializza un'istanza della JsonStringEnumConverter classe con un criterio di denominazione specificato e un valore che indica se sono consentiti valori di enumerazione non definiti.

Proprietà

Nome Descrizione
Type

Ottiene il tipo convertito dall'istanza del convertitore corrente.

(Ereditato da JsonConverterFactory)

Metodi

Nome Descrizione
CanConvert(Type)

Determina se il tipo specificato può essere convertito in un'enumerazione.

CreateConverter(Type, JsonSerializerOptions)

Crea un convertitore per il tipo specificato.

Equals(Object)

Determina se l'oggetto specificato è uguale all'oggetto corrente.

(Ereditato da Object)
GetHashCode()

Funge da funzione hash predefinita.

(Ereditato da Object)
GetType()

Ottiene il Type dell'istanza corrente.

(Ereditato da Object)
MemberwiseClone()

Crea una copia superficiale del Objectcorrente.

(Ereditato da Object)
ToString()

Restituisce una stringa che rappresenta l'oggetto corrente.

(Ereditato da Object)

Si applica a