unitytips: Expression body definition

When you have a single line method, you can use expression body definition do simplify and reduce the lines of code:

post image


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


Loading comments...
Tutorials

Articles

Labs