Editorconfig Guide.e

Prefer expression bodied local functions

EditorConfig key: csharp-style-expression-bodied-local-functions

Prefer expression bodied local functions

csharp-style-expression-bodied-local-functions

This option controls whether local functions should be written using expression-bodied syntax.

Default value:

false

Possible values:

  • true
  • false
  • when_on_single_line

Examples

true
int Square(int x) => x * x;
false
int Square(int x)
{
  return x * x;
}
when_on_single_line
int Square(int x) => x * x;