Properties as Expression body members - Part 44

preview_player
Показать описание
Property accessors often consist of single-line statements that just assign or return the result of an expression.
You can implement these properties as expression-bodied members.
Starting with C# 6, read-only properties can implement the get accessor as an expression-bodied member.
Starting with C# 7.0, both the get and the set accessor can be implemented as expression-bodied members.
Рекомендации по теме