Compiler-as-a-service release: string interpolation, null-conditional operators, nameof and expression-bodied members.
This release added 8 features, each with a before-and-after example.
Features in C# 6.0
- Auto property initializer - Allow auto-implemented properties to have an initial value.
- Exception filters - Conditionally catch exceptions based on a boolean expression.
- Expression bodied members - Declare members using
=>arrow functions. - Index initializers - Allow indexers to be set from object or collection initializers.
- nameof operator - Capture the name of a variable, type or member at compile time.
- Null-conditional operators - Safely access members on potentially null objects.
- String interpolation - Build formatted strings with in-place evaluation.
- using static - Import static members as top-level functions.