As others have shown, you can use the lambda statement (with curly braces) to do this:
parameter-list => { statements; }
However, it is worth noting that this has a limitation: you cannot convert the lambda operator to an expression tree, but only a delegate. So, for example, this works:
Func<int> x = () => { return 5; };
But this is not so:
Expression<Func<int>> y = () => { return 5; };
source share