YamlNamingPolicyAttribute Class

Specifies the naming policy used to convert the names of the annotated member or of all members of the annotated type.

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface, AllowMultiple = false)]
public sealed class YamlNamingPolicyAttribute : YamlAttribute

Remarks

When applied to a type, it sets the naming policy for all members declared on that type. When applied to a member, it overrides the type-level and serializer-level naming policy for that member. YamlPropertyNameAttribute takes precedence over this attribute.

Inheritance
YamlAttribute YamlNamingPolicyAttribute

Constructors

NameDescription
YamlNamingPolicyAttribute(YamlKnownNamingPolicy)Initializes a new instance of the YamlNamingPolicyAttribute class.

YamlNamingPolicyAttribute(YamlKnownNamingPolicy)

YamlNamingPolicyAttribute.cs

Initializes a new instance of the YamlNamingPolicyAttribute class.

public YamlNamingPolicyAttribute(YamlKnownNamingPolicy namingPolicy)

Parameters

namingPolicy YamlKnownNamingPolicy
The naming policy to apply. Use YamlKnownNamingPolicy.Unspecified to use the CLR names as-is.

Properties

NameDescription
NamingPolicyGets the naming policy to apply.

Gets the naming policy to apply.

public YamlKnownNamingPolicy NamingPolicy { get; }

Property value

YamlKnownNamingPolicy