JustCode can suggest you to convert an if-else statement to a conditional expression where possible.
Note |
|---|
Language Support Supported: C#, VB.NET Not supported: JavaScript, ASP.NET, XAML, HTML |
The behavior can be controlled in JustCode Options -
JustCode / Options / Code Analysis / Hints / C#.
When "Show hint for convert if statement to conditional expression" option is checked in the options dialog,
then JustCode suggests you to to convert an if-else statement to a conditional expression where possible.
To convert if statement to conditional expression
Position the caret on the condition part of an if-else statement which can be converted to a conditional expression.
Select Convert if statement to conditional expression from the VisualAid's Fixes menu.
The result is:
See Also