| layout | page |
|---|---|
| title | CC0073 |
| tagline | AddBracesToSwitchSectionsAnalyzer |
|TypeName|AddBracesToSwitchSectionsAnalyzer | |Check Id | CC0073 | |Category | Refactoring | |Severity | Hidden |
Add curly braces to a switch statement.
{% highlight csharp %} int value = 2; switch (value) { case 1: Console.WriteLine(1); break; case 2: Console.WriteLine(2); break; default: Console.WriteLine(0); break; } {% endhighlight %}
A code fix will be presented to you that will transform the code.
{% highlight csharp %} int value = 2; switch (value) { case 1: { Console.WriteLine(1); break; } case 2: { Console.WriteLine(2); break; } default: { Console.WriteLine(0); break; } } {% endhighlight %}

TBD
TBD