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

Default interface methods

// provide interface method implementations to inherit

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

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: Target typed new

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

9.0

2020-11-10

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

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

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: 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: 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: Const

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

10.0

2021-11-08

String interpolation: Custom handler

🧩 InterpolatedStringHandlerAttribute

10.0

2021-11-08

String interpolation: Verbatim enhancement

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

8.0

2019-09-23

Struct initializers

Parameter { 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

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