JsonTypeInfo.CreateJsonPropertyInfo(Type, String) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Crée une instance vide JsonPropertyInfo pour le fichier actif JsonTypeInfo.
public:
System::Text::Json::Serialization::Metadata::JsonPropertyInfo ^ CreateJsonPropertyInfo(Type ^ propertyType, System::String ^ name);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
public System.Text.Json.Serialization.Metadata.JsonPropertyInfo CreateJsonPropertyInfo(Type propertyType, string name);
public System.Text.Json.Serialization.Metadata.JsonPropertyInfo CreateJsonPropertyInfo(Type propertyType, string name);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")>]
member this.CreateJsonPropertyInfo : Type * string -> System.Text.Json.Serialization.Metadata.JsonPropertyInfo
member this.CreateJsonPropertyInfo : Type * string -> System.Text.Json.Serialization.Metadata.JsonPropertyInfo
Public Function CreateJsonPropertyInfo (propertyType As Type, name As String) As JsonPropertyInfo
Paramètres
- propertyType
- Type
Type déclaré pour la propriété.
- name
- String
Nom de propriété utilisé dans la sérialisation ET la désérialisation JSON.
Retours
Instance vide JsonPropertyInfo .
- Attributs
Exceptions
propertyType ou name est null.
propertyType ne peut pas être utilisé pour la sérialisation.
L’instance JsonTypeInfo a été verrouillée pour une modification supplémentaire.