In C# 7 there are Expression Bodied Accessors which allows you to write getter and setters somewhat more functional way, somewhat lambda’ish. Let me show you an example. You may remember the old way of writing getter and setters like below. Pre Expression Bodied Accessors Getter and Setter
1 2 3 4 5 6 7 8 9 |
public class Automobile { private string _brand; public string Brand { get { return _brand; } set { _brand = value; } } } |
Expression Bodied Accessors in C# 7 […]