JsonTypeInfo.CreateJsonPropertyInfo(Type, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a blank JsonPropertyInfo instance for the current 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
Parameters
- propertyType
- Type
The declared type for the property.
- name
- String
The property name used in JSON serialization and deserialization.
Returns
A blank JsonPropertyInfo instance.
- Attributes
Exceptions
propertyType or name is null.
propertyType cannot be used for serialization.
The JsonTypeInfo instance has been locked for further modification.