.NET 5 & C# 9 - A look at what’s new

A presentation at DDD20 in December 2020 in by Stuart Lang

Slide 1

Slide 1

.NET 5 & C# 9

A look at what’s new

Slide 2

Slide 2

HELLO!

#DDD20 I am Stuart Lang You can find me at https://stu.dev

Slide 3

Slide 3

Agenda

› .NET 5 › What is it › Support › What’s new

C# 9 › Top-level programs › Patterns › Records › Source Generators

Slide 4

Slide 4

What's .NET 5

Slide 5

Slide 5

What's .NET 5

Slide 6

Slide 6

Release Plan

https://blog.inedo.com/demystifying-net-lts

Slide 7

Slide 7

Consider Ecosystem Support

Slide 8

Slide 8

Porting to .NET 5

try-convert: https://github.com/dotnet/try-convert

Slide 9

Slide 9

.NET Conf 2020

.NET Conf 2020 https://www.youtube.com/playlist?list=PLdo4fOcmZ0oVWop1HEOml2OdqbDs6IlcI

Slide 10

Slide 10

.NET 5 Features

› C# 9 › Performance ⚡ Link - https://devblogs.microsoft.com/dotnet/performance-improvements-in-net-5/ › Single file apps › App trimming › System.Text.Json new features › F# 5 › And more

Slide 11

Slide 11

C# 9

Slide 12

Slide 12

Top-level programs

  • demo *

Slide 13

Slide 13

Patterns

Slide 14

Slide 14

Patterns - Switch Expressions

Slide 15

Slide 15

Patterns - Switch Expressions

Slide 16

Slide 16

Patterns - Switch Expressions

Slide 17

Slide 17

Patterns - Switch Expressions

Slide 18

Slide 18

Patterns - Examples

Slide 19

Slide 19

Patterns - Examples

Slide 20

Slide 20

Patterns - Examples

Slide 21

Slide 21

Records

  • demo *

Slide 22

Slide 22

Source Generators

Slide 23

Slide 23

Source Generators

Program Code Source Generator Generated Output

Slide 24

Slide 24

Slide 25

Slide 25

Source Generators - Roslyn

Source code Syntax Tree Semantic Model Emit IL

Slide 26

Slide 26

Source Generators

  • demo *

Slide 27

Slide 27

THANKS!

Any questions? You can find me at: @stuartblang · stu.dev