C# language feature:

  • Expression bodied getters and setters

applies to

  • properties

benefit

  • Allows use of expressions in getters and setters.

how to use

  • In place of declaring body, insert => followed by expressions and ;

example:

        double PI { get => 3.14; }