First of all, that is not lambda, although syntax is similar.
It is called "expression-bodied members". They are similar to lambdas, but still fundamentally different. Obviously they can't capture local variables like lambdas do. Also, unlike lambdas, they are accessible via their name:) You will probably understand this better if you try to pass an expression-bodied property as a delegate.
There is no such syntax for setters in C# 6.0, but C# 7.0 introduces it.
private int _x;
public int X
{
get => _x;
set => _x = value;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…