All rules
CA1727Naming Enabled by default: No

Use PascalCase for named placeholders

Use PascalCase for named placeholders

Microsoft docs

Description

A named placeholder used with Microsoft.Extensions.Logging.ILogger should be PascalCase, a naming convention where the first letter of each compound word in a name is capitalized. This naming convention is recommended for structured logging, where each named placeholder is used as a property name in the structured data.

Cause

A named placeholder used with Microsoft.Extensions.Logging.ILogger is not PascalCase.

How to fix violations

Use PascalCase for named placeholders. For example, change {firstName} to {FirstName}.

Example

#pragma warning disable CA1727
// The code that's violating the rule is on this line.
#pragma warning restore CA1727

When to suppress

It is safe to suppress a warning from this rule.

Group results
0 yes 0 no
ConsensusNone (disabled)
Severity preference (yes voters)
Suggestion0
Warning0
Error0