C# has added many new keywords, syntax elements, and features since its introduction.

Feature Keyword/Syntax Version Released

Anonymous methods

⌨️ delegate

2.0

2006-01-22

Asynchronous members

⌨️ async ⌨️ await

5.0

2012-08-15

Asynchronous streams

async IAsyncEnumerable<T> Method( … )

8.0

2019-09-23

Discards

_

7.0

2017-04-05

Dynamic binding

⌨️ dynamic

4.0

2010-04-12

Exceptions: Exception filters

catch (ExceptionType e) when expression

6.0

2014-11-12

Exceptions: Throw expressions

expr ? expr : throw exception 🔹 x ?? throw exception 🔹 Member ⇒ throw exception

7.0

2017-04-05

Expression bodied members

Member expression; // method, operator, or read-only property

6.0

2014-11-12

Expression bodied members: Expanded

// constructors, finalizers, indexers, and all properties now supported

7.0

2017-04-05

Extension methods

Method(this Type param)

3.0

2007-11-19

Function pointers

⌨️ delegate

9.0

2020-11-10

Generics

Type<T> and 🧩 System.Collections.Generic

2.0

2006-01-22

Generics: INumber

🧩 INumber<T>

11.0

2022-11-08

Global usings

global using Namespace ;

10.0

2021-11-08

Indices and ranges

❇️ ^ ❇️ .. 🧩 System.Index 🧩 System.Range

8.0

2019-09-23

Initialization: Anonymous types

new { }

3.0

2007-11-19

Initialization: Implicitly typed local variables

⌨️ var

3.0

2007-11-19

Initialization: Index initializers

❇️ new Dictionary<_type_,type> { [value] = value, }

6.0

2014-11-12

Initialization: Initializers

new Type { … } 🔹 new CollectionType { item, item, item, … }

3.0

2007-11-19

Initialization: Required

❇️ required fieldOrProperty

11.0

2022-11-08

Initialization: Target typed new

// new() doesn’t require a type name when inferrable

9.0

2020-11-10

Interfaces: Default methods

// provide interface method implementations to inherit

8.0

2019-09-23

Interfaces: Static virtual

static virtual or abstract virtual

11.0

2022-11-08

Iterators

⌨️ yield return

2.0

2006-01-22

Lambda expressions

params expression

3.0

2007-11-19

Lambda expressions: Attributes

var name = [Attribute] paramsexpression ;

10.0

2021-11-08

Lambda expressions: Discard params

() ⇒ _expression

9.0

2020-11-10

Lambda expressions: Natural type

var name = paramsexpression ; _// or name as object, Delegate, &c

10.0

2021-11-08

Lambda expressions: Return type

var name = returntype paramsexpression ;

10.0

2021-11-08

Literals: Binary literals

0b10011

7.0

2017-04-05

Literals: Default literals

⌨️ default

7.1

2017-08-14

Literals: Digit separators

7_000_000

7.0

2017-04-05

Literals: Raw strings

// multiline, multiquoted, indented string literals

11.0

2022-11-08

Literals: UTF-8 strings

"string literal"u8

11.0

2022-11-08

Local functions

type Name() { type OtherName() { … } … OtherName(); }

7.0

2017-04-05

Local functions: Attributes

// attributes are allowed before local functions

9.0

2020-11-10

Local functions: Extern

// local functions may be marked as extern

9.0

2020-11-10

Local functions: Static

// local functions can now be static

8.0

2019-09-23

Module initializers

[ModuleInitializer] Method() { … }

9.0

2020-11-10

Nameof operator

⌨️ nameof()

6.0

2014-11-12

Native sized integers

⌨️ nint // System.IntPtr ⌨️ nuint // System.UIntPtr

9.0

2020-11-10

Nesting: File scoped namespaces

namespace Name ;

10.0

2021-11-08

Nesting: Top level statements

// statements in one source file outside any containing method imply program entry point

9.0

2020-11-20

Nesting: Using declarations

using var x = disposble; // applies to end of scope

8.0

2019-09-23

Nulls: Null forgiving operator

❇️ !

8.0

2019-09-23

Nulls: Null propagator

❇️ x?.member ❇️ x?[expression]

6.0

2014-11-12

Nulls: Null-coalescing assignment

❇️ ??=

8.0

2019-09-23

Nulls: Nullable types

🧩 Nullable<T> ❇️ Type?

2.0

2006-01-22

Nulls: Nullable types: Reference types

// reference types may not be null without ?, and require null-checking with it

8.0

2019-09-23

Operators: Checked/unchecked

❇️ checked or unchecked

11.0

2022-11-08

Parameters: Caller info attributes

🧩 CallerFilePathAttribute 🧩 CallerLineNumberAttribute 🧩 CallerMemberNameAttribute

5.0

2012-08-15

Parameters: Caller info attributes: Expression

🧩 CallerArgumentExpressionAttribute

10.0

2021-11-08

Parameters: In parameters

⌨️ in

7.2

2017-12-04

Parameters: Named arguments

Method( paramName: value)

4.0

2010-04-12

Parameters: Non-trailing named arguments

// named params can precede unnamed ones that are in the right position

7.2

2017-12-04

Parameters: Out variables

Method(out var param)

7.0

2017-04-05

Partial classes

⌨️ partial class ⌨️ partial interface ⌨️ partial struct

2.0

2006-01-22

Partial Methods

⌨️ partial type Method( … );

3.0

2007-11-19

Pattern matching

expression is pattern // or is not 🔹 switch(expression) { case pattern: … }

7.0

2017-04-05

Pattern matching: Character spans

charSpan is "string literal"

11.0

2022-11-08

Pattern matching: Conjunction

x is pattern and pattern

9.0

2020-11-10

Pattern matching: Disjunction

x is pattern or pattern

9.0

2020-11-10

Pattern matching: Lists

value is [1, 2, 3, _, 5, ..]

11.0

2022-11-08

Pattern matching: Negation

x is not pattern // not just types

9.0

2020-11-10

Pattern matching: Parentheses

x is ( patterns ) and ( patterns )

9.0

2020-11-10

Pattern matching: Properties

expression is { Property: value }

8.0

2019-09-23

Pattern matching: Properties: Extended

expression is { Property.Subproperty: value }

10.0

2021-11-08

Pattern matching: Relational

x is > value // or >= < ⇐

9.0

2020-11-10

Pattern matching: Switch expressions

expression switch { patternvalue, … }

8.0

2019-09-23

Pattern matching: Tuples

expression is ( value/identifier , …)

8.0

2019-09-23

Pattern matching: Type variables

x is type

9.0

2020-11-10

Properties: Auto properties

Property { get; set; }

3.0

2007-11-19

Properties: Auto properties: Initializers

Property { get; set; } = value;

6.0

2014-11-12

Properties: Init only setters

Property { get; init; }

9.0

2020-11-10

Query expressions

⌨️ from item in Items where item != null orderby item select item

3.0

2007-11-19

Readonly members

⌨️ readonly Method

8.0

2019-09-23

Records

⌨️ record

9.0

2020-11-10

Records: Record structs

record struct

10.0

2021-11-08

Static imports

using static Namespace.StaticClassName ;

6.0

2014-11-12

Static lambdas and anonymous funcions

// lambdas and anonymous functions may be static

9.0

2020-11-10

String interpolation

❇️ $"…{expression}…"

6.0

2014-11-12

String interpolation: Braces

$$""{"value": "{{value}}"}"" // multiple $ add extra { } for interpolation

11.0

2022-11-08

String interpolation: Const

const string name = $"…{constantexpr}…";

10.0

2021-11-08

String interpolation: Custom handler

🧩 InterpolatedStringHandlerAttribute

10.0

2021-11-08

String interpolation: Newlines

// newlines allowed within interpolation expressions

11.0

2022-11-08

String interpolation: Verbatim enhancement

❇️ @$"…" (previously only $@"…" worked)

8.0

2019-09-23

Struct initializers

Property { get; init; } = value ;

10.0

2021-11-08

Suppress emitting localsinit

🧩 SkipLocalsInitAttribute

9.0

2020-11-10

Tuples and deconstruction

(type, …) x = (value, …); // or with (_type PropertyName, …)

7.0

2017-04-05

Tuples: Inferred element names

list.Select(x ⇒ (x.Id, x.Name)).Where(y ⇒ y.Id == 1)

7.1

2017-08-14

Types: Pointer aliases

nint or nuint

11.0

2022-11-08

Visibility: File scope

file class MyClassName

11.0

2022-11-08

Source: Microsoft Docs: C# Guide: The history of C# and What’s new in C# 10 and What’s new in C# 11