diff --git a/docs/fundamentals/code-analysis/quality-rules/ca1716.md b/docs/fundamentals/code-analysis/quality-rules/ca1716.md index 7bc744fd4a850..992a6eecd9132 100644 --- a/docs/fundamentals/code-analysis/quality-rules/ca1716.md +++ b/docs/fundamentals/code-analysis/quality-rules/ca1716.md @@ -10,6 +10,8 @@ helpviewer_keywords: - CA1716 author: gewarren ms.author: gewarren +dev_langs: +- CSharp --- # CA1716: Identifiers should not match keywords @@ -43,6 +45,10 @@ Case-insensitive comparison is used for Visual Basic keywords, and case-sensitiv Select a name that does not appear in the list of keywords. +## Example + +:::code language="csharp" source="snippets/csharp/all-rules/ca1716.cs" id="snippet1"::: + ## When to suppress warnings You can suppress a warning from this rule if you're sure that the identifier won't confuse users of the API, and that the library is usable in all available languages in .NET. diff --git a/docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca1716.cs b/docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca1716.cs new file mode 100644 index 0000000000000..0f8eba0e729e9 --- /dev/null +++ b/docs/fundamentals/code-analysis/quality-rules/snippets/csharp/all-rules/ca1716.cs @@ -0,0 +1,13 @@ +namespace ca1716 +{ + // + // This code violates the rule. + public class Class { } + public class Event { } + public class String { } + public class Namespace { } + public class Object { } + public class Public { } + public class Static { } + // +}