C# has added many new keywords, syntax elements, and features since its introduction.
Feature | Keyword/Syntax | Version |
---|---|---|
Anonymous methods |
|
2.0 |
Asynchronous members |
|
5.0 |
Asynchronous streams |
|
8.0 |
Discards |
|
7.0 |
Dynamic binding |
|
4.0 |
Exceptions: Exception filters |
|
6.0 |
Exceptions: Throw expressions |
|
7.0 |
Expression bodied members |
|
6.0 |
Expression bodied members: Expanded |
|
7.0 |
Extension methods |
|
3.0 |
Function pointers |
|
9.0 |
Generics |
|
2.0 |
Generics: INumber |
|
11.0 |
Global usings |
|
10.0 |
Indices and ranges |
|
8.0 |
Initialization: Anonymous types |
|
3.0 |
Initialization: Implicitly typed local variables |
|
3.0 |
Initialization: Index initializers |
|
6.0 |
Initialization: Index reverse |
|
13.0 |
Initialization: Initializers |
|
3.0 |
Initialization: Required |
|
11.0 |
Initialization: Target typed new |
|
9.0 |
Interfaces: Default methods |
|
8.0 |
Interfaces: Static virtual |
|
11.0 |
Iterators |
|
2.0 |
Lambda expressions |
|
3.0 |
Lambda expressions: Attributes |
|
10.0 |
Lambda expressions: Discard params |
|
9.0 |
Lambda expressions: Natural type |
|
10.0 |
Lambda expressions: Param defaults |
|
12.0 |
Lambda expressions: Return type |
|
10.0 |
Literals: Binary literals |
|
7.0 |
Literals: Collection expressions |
|
12.0 |
Literals: Default literals |
|
7.1 |
Literals: Digit separators |
|
7.0 |
Literals: Escape escape |
|
13.0 |
Literals: Raw strings |
|
11.0 |
Literals: UTF-8 strings |
|
11.0 |
Local functions |
|
7.0 |
Local functions: Attributes |
|
9.0 |
Local functions: Extern |
|
9.0 |
Local functions: Static |
|
8.0 |
Module initializers |
|
9.0 |
Multithreading: New lock object |
|
13.0 |
Nameof operator |
|
6.0 |
Native sized integers |
|
9.0 |
Nesting: File scoped namespaces |
|
10.0 |
Nesting: Top level statements |
|
9.0 |
Nesting: Using declarations |
|
8.0 |
Nulls: Null forgiving operator |
|
8.0 |
Nulls: Null propagator |
|
6.0 |
Nulls: Null-coalescing assignment |
|
8.0 |
Nulls: Nullable types |
|
2.0 |
Nulls: Nullable types: Reference types |
|
8.0 |
Operators: Checked/unchecked |
|
11.0 |
Parameters: Caller info attributes |
|
5.0 |
Parameters: Caller info attributes: Expression |
|
10.0 |
Parameters: In parameters |
|
7.2 |
Parameters: Named arguments |
|
4.0 |
Parameters: Non-trailing named arguments |
|
7.2 |
Parameters: Params collections |
|
13.0 |
Parameters: Out variables |
|
7.0 |
Parameters: Ref readonly parameters |
|
12.0 |
Partial classes |
|
2.0 |
Partial Methods |
|
3.0 |
Pattern matching |
|
7.0 |
Pattern matching: Character spans |
|
11.0 |
Pattern matching: Conjunction |
|
9.0 |
Pattern matching: Disjunction |
|
9.0 |
Pattern matching: Lists |
|
11.0 |
Pattern matching: Negation |
|
9.0 |
Pattern matching: Parentheses |
|
9.0 |
Pattern matching: Properties |
|
8.0 |
Pattern matching: Properties: Extended |
|
10.0 |
Pattern matching: Relational |
|
9.0 |
Pattern matching: Switch expressions |
|
8.0 |
Pattern matching: Tuples |
|
8.0 |
Pattern matching: Type variables |
|
9.0 |
Properties: Auto properties |
|
3.0 |
Properties: Auto properties: Initializers |
|
6.0 |
Properties: Init only setters |
|
9.0 |
Query expressions |
|
3.0 |
Readonly members |
|
8.0 |
Records |
|
9.0 |
Records: Record structs |
|
10.0 |
Static imports |
|
6.0 |
Static lambdas and anonymous funcions |
|
9.0 |
String interpolation |
|
6.0 |
String interpolation: Braces |
|
11.0 |
String interpolation: Const |
|
10.0 |
String interpolation: Custom handler |
|
10.0 |
String interpolation: Newlines |
|
11.0 |
String interpolation: Verbatim enhancement |
|
8.0 |
Struct initializers |
|
10.0 |
Suppress emitting localsinit |
|
9.0 |
Tuples: Deconstruction |
|
7.0 |
Tuples: Inferred element names |
|
7.1 |
Types: Alias any type |
|
12.0 |
Types: Experimental attribute |
|
12.0 |
Types: Pointer aliases |
|
11.0 |
Types: Primary constructors |
|
12.0 |
Visibility: File scope |
|
11.0 |