Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/fundamentals/code-analysis/quality-rules/ca1720.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ helpviewer_keywords:
- CA1720
author: gewarren
ms.author: gewarren
dev_langs:
- CSharp
---
# CA1720: Identifiers should not contain type names

Expand Down Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System;

namespace ca1720
{
//<snippet1>
// This code violates the rule.
public class Short
{
public int Int32 { get; set; }
public Guid Guid { get; set; }

public void Float(int int32) { }
}
//</snippet1>
}