TypeName | TernaryOperatorAnalyzer (assignment) |
Check Id | CC0014 |
Category | Style |
Severity | Warning |
If-else statements can be changed to ternary operators.
var something = true;
string a;
if (something)
{
a = "a";
}
else
{
a = "b";
}
A code fix will be presented to you that will transform the code:
var something = true;
string a;
a = something ? "a" : "b";
TBD