C# language feature:

  • Expression bodied constructors and finalizers

applies to

  • constructors, finalizers

benefit

  • Allow use of expressions in constructors and finalizers.

how to use

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

example:

        class myObject {
            myObject() => System.Console.WriteLine("myObject created");
            ~myObject() => System.Console.WriteLine("myObject destroyed");
        }