Skip to content
Merged
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/ca1700.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ helpviewer_keywords:
- CA1700
author: gewarren
ms.author: gewarren
dev_langs:
- CSharp
---
# CA1700: Do not name enum values 'Reserved'

Expand Down Expand Up @@ -43,6 +45,10 @@ In a limited number of cases the addition of a member is a breaking change even

To fix a violation of this rule, remove or rename the member.

## Example

:::code language="csharp" source="snippets/csharp/all-rules/ca1700.cs" id="snippet1":::

## When to suppress warnings

It is safe to suppress a warning from this rule for a member that is currently used or for libraries that have previously shipped.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace ca1700
{
//<snippet1>
// This enum violates the rule.
public enum BadPaymentStatus
{
Pending = 0,
Completed = 1,
ReservedError = 2,
Reserved = 3,
}

// This enum satisfies the rule.
public enum GoodPaymentStatus
{
Pending = 0,
Completed = 1,
Error = 2,
Unknown = 3,
}
//</snippet1>
}