coderushforroslyn-115599-refactoring-assistance-use-expression-body.md
Converts a property, method, constructor, destructor, getter or setter into the expression-bodied structure.
Available in the following cases.
Place the caret on a method name.
Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
Select Use Expression Body from the menu.
After execution, the Refactoring converts the traditional method declaration to the expression-bodied structure.
double ConvertToUSD(Currency source, double amount) => amount / GetCurrencyRate(source);
Note
This feature is available as a part of Code Cleanup.
See Also
Compress to/Expand Ternary Expression