72
C# New Features | C# Version Features
Microsoft has added too many new features in C# language. A list of newly added features in each versions are given below:
C# 2.0
- Partial types
- Iterators
- Nullable types
- Delegate Covariance
- Delegate inference
- Static classes
- Method group conversions (delegates)
C# 3.0
- Anonymous types
- Extension methods
- Query expression
- Partial method
- Implicitly typed local variables
- Object and collection initializers
- Auto-Implemented properties
- Lambda expression
- Expression trees
C# 4.0
- Dynamic binding
- Named and optional arguments
- Generic co and contravariance
- Embedded interop types (“NoPIA”)
C# 5.0
C# 6.0
- Using static directive
- Exception filters
- Await in catch/finally blocks
- Auto property initializers
- Default values for getter-only properties
- Expression-bodied members
- Null propagator
- String interpolation
- Nameof operator
- Dictionary initializer
- Compiler-as-a-service (Roslyn)
C# 7.0
- Pattern matching
- Tuples
- Deconstruction
- Local functions
- Digit separator
- Binary literals
- Ref returns and locals
- Expression bodied constructors and finalizers
- Expression bodied getters and setters
- Out variables
- Generalized async return types
C# 7.1
Next TopicC# Partial Types