A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1727 below:

CA1727: Use PascalCase for named placeholders (code analysis) - .NET

Property Value Rule ID CA1727 Title Use PascalCase for named placeholders Category Naming Fix is breaking or non-breaking Non-breaking Enabled by default in .NET 9 No Cause

A named placeholder used with ILogger is not PascalCase.

Rule description

A named placeholder used with 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.

How to fix violations

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

When to suppress warnings

It is safe to suppress a warning from this rule.

Suppress a warning

If you just want to suppress a single violation, add preprocessor directives to your source file to disable and then re-enable the rule.

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

To disable the rule for a file, folder, or project, set its severity to none in the configuration file.

[*.{cs,vb}]
dotnet_diagnostic.CA1727.severity = none

For more information, see How to suppress code analysis warnings.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4