Table of Contents

SetPropertyName Method

Definition

Namespace
Cuemon.Extensions.Text.Json
Assemblies
Cuemon.Extensions.Text.Json.dll
Source
src/Cuemon.Extensions.Text.Json/JsonSerializerOptionsExtensions.cs

SetPropertyName(JsonSerializerOptions, string)

Returns the specified name adhering to the underlying PropertyNamingPolicy.

public static string SetPropertyName(this JsonSerializerOptions options, string name)

Parameters

options JsonSerializerOptions

The options from which to apply a property naming policy.

name string

The name to apply to a JSON property.

Returns

string

When PropertyNamingPolicy is null, the specified name is returned unaltered; otherwise it is converted according to the JsonNamingPolicy.

Remarks

A convenient way of defining the property name according to Microsoft design decisions.