C# language feature:

  • Default values for Read-only Auto-properties

applies to

  • Auto-Implemented properties

benefit

  • Allows setting of read-only auto-properties when declaring (previously could only be set in constructors).

how to use

  • After the auto-implemented properties declaration body insert = and value followed by ;

example:

        public double PI { get; } = 3.14;