unitytips: Expression body definition
27/08/2019
When you have a single line method, you can use expression body definition do simplify and reduce the lines of code:
![post image](/assets/2019/08/27/unitytips-expression-body-definition/expression-body-definition-methods.gif )
Expression body definitions for methods and read-only properties are supported starting with C# 6. Expression body definitions for constructors, finalizers, property accessors, and indexers are supported starting with C# 7.0.
So you can use the expression body definition for other members, like properties:
![post image](/assets/2019/08/27/unitytips-expression-body-definition/expression-body-definition-properties.gif )
Loading comments...