Fundamentally, is there any difference between a single-line expression lambda and a statement lambda? Take the following code, for example:
private delegate
Same for the OP example, but after C# 6.0, allowing you to use same expression syntax to define normal non-lambda methods within a class. For example:
public static double AreaOfTriangle(double itsbase, double itsheight)
{
return itsbase * itsheight / 2;
}
The above code snippet can be written only if the method can be turned into a single expression. In short, it can be used the expression lambda syntax, but not the statement lambda syntax.
public static double
AreaOfTrianglex(double itsbase, double itsheight) => itsbase * itsheight / 2;