JsonSerializerOptions.DictionaryKeyPolicy Property

Definition

Gets or sets the policy used to convert a IDictionary key's name to another format, such as camel-casing.

public:
 property System::Text::Json::JsonNamingPolicy ^ DictionaryKeyPolicy { System::Text::Json::JsonNamingPolicy ^ get(); void set(System::Text::Json::JsonNamingPolicy ^ value); };
public System.Text.Json.JsonNamingPolicy? DictionaryKeyPolicy { get; set; }
public System.Text.Json.JsonNamingPolicy DictionaryKeyPolicy { get; set; }
member this.DictionaryKeyPolicy : System.Text.Json.JsonNamingPolicy with get, set
Public Property DictionaryKeyPolicy As JsonNamingPolicy

Property Value

The policy used to convert a IDictionary key's name to another format.

Remarks

This property can be set to JsonNamingPolicy.CamelCase to specify a camel-casing policy.

This property can be set to CamelCase to specify a camel-casing policy.

It is not used when deserializing.

For more information, see How to customize property names and values with System.Text.Json.

Applies to