A lambda expression is a block of code (an expression or a statement block) that is treated as an object. It can be passed as an argument to methods, and it can also be returned by method calls.
(input parameters) => expression
SomeFunction(x => x * x);
Looking this statement I was wondering what's the difference when using lambdas and when using Expression-bodied?
public string Name => First + " " + Last;
Expression bodied methods are syntactic sugar. Instead of writing this:
you can just write this:
and the result of calling either the first or the second would be exactly the same.
The same is true also for all the kinds of expression body members.
On the other hand, a lambda expressions as it is stated formally here is:
That being said it is clear that despite the similarity in syntax, there are two completely different things.