LANGUAGE
Expression-bodied method
Defines a short method with an expression body.
Formal Syntax & Structure
csharp syntaxcsharp
int Name(int n) => expression;Working Example
Example Snippetcsharp
static int Square(int n) => n * n;Defines a short method with an expression body.
int Name(int n) => expression;static int Square(int n) => n * n;