diff --git a/docs/fundamentals/code-analysis/quality-rules/ca1720.md b/docs/fundamentals/code-analysis/quality-rules/ca1720.md index 93e737b5c6e8f..0378767cb9528 100644 --- a/docs/fundamentals/code-analysis/quality-rules/ca1720.md +++ b/docs/fundamentals/code-analysis/quality-rules/ca1720.md @@ -10,6 +10,8 @@ helpviewer_keywords: - CA1720 author: gewarren ms.author: gewarren +dev_langs: +- CSharp --- # CA1720: Identifiers should not contain type names @@ -91,6 +93,10 @@ Replace the data type identifier in the name of the parameter with either a term Replace the language-specific data type identifier in the name of the member with a term that better describes its meaning, a language-independent equivalent, or a more generic term, such as 'value'. +## Example + +:::code language="csharp" source="snippets/csharp/all-rules/ca1720.cs" id="snippet1"::: + ## When to suppress warnings Occasional use of type-based parameter and member names might be appropriate. However, for new development, no known scenarios occur where you should suppress a warning from this rule. For libraries that have previously shipped, you might have to suppress a warning from this rule. diff --git a/docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca1720.cs b/docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca1720.cs new file mode 100644 index 0000000000000..249a6ba73c6ea --- /dev/null +++ b/docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca1720.cs @@ -0,0 +1,15 @@ +using System; + +namespace ca1720 +{ + // + // This code violates the rule. + public class Short + { + public int Int32 { get; set; } + public Guid Guid { get; set; } + + public void Float(int int32) { } + } + // +}