다음을 통해 공유


Parameter names should not match member names

TypeName

ParameterNamesShouldNotMatchMemberNames

CheckId

CA1719

Category

Microsoft.Naming

Breaking Change

Breaking

Cause

The name of an externally visible member matches, in a case-insensitive comparison, the name of one of its parameters.

Rule Description

A parameter name should convey a parameter's meaning and a member name should convey a member's meaning. It would be a rare design where these were the same. Naming a parameter the same as its member name is unintuitive and makes the library difficult to use.

How to Fix Violations

Select a parameter name that does not match the member name.

When to Exclude Warnings

For new development, there are no known scenarios where it is necessary to exclude a warning from this rule. For shipping libraries, it might be necessary to exclude a warning from this rule.

Long acronyms should be pascal-cased

Short acronyms should be uppercase

Identifiers should be cased correctly

Identifiers should differ by more than case

Identifiers should not contain underscores

Avoid type names in parameters

Avoid language specific type names in parameters