Skip to content

Commit 92e6a29

Browse files
authored
Add code example for CA1711 rule (#48951) (#48952)
1 parent 5d55688 commit 92e6a29

File tree

1 file changed

+17
-0
lines changed
  • docs/fundamentals/code-analysis/quality-rules

1 file changed

+17
-0
lines changed

docs/fundamentals/code-analysis/quality-rules/ca1711.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ helpviewer_keywords:
1010
- IdentifiersShouldNotHaveIncorrectSuffix
1111
author: gewarren
1212
ms.author: gewarren
13+
dev_langs:
14+
- CSharp
1315
---
1416
# CA1711: Identifiers should not have incorrect suffix
1517

@@ -61,6 +63,21 @@ Naming conventions provide a common look for libraries that target the .NET comm
6163

6264
Remove the suffix from the type name.
6365

66+
## Example
67+
68+
```csharp
69+
class BadEmployeeCollection { } // Violates CA1711
70+
71+
// Good
72+
class Employee { }
73+
class GoodEmployeeCollection : ICollection<Employee>
74+
{
75+
// Implementations
76+
}
77+
78+
class Employees { } // Good
79+
```
80+
6481
## When to suppress warnings
6582

6683
Do not suppress a warning from this rule unless the suffix has an unambiguous meaning in the application domain.

0 commit comments

Comments
 (0)