C# language feature:

  • Expression-bodied members

applies to

  • class members

benefit

  • Simplifies method body of class members.

how to use

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

example:

        public string FirstName { get; set; }
        public string SirName { get; set; }

        public override string ToString() => $"{SirName}, {FirstName}";