What's New in C#7 and C# 8
4.3 (424 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
6,595 students enrolled

What's New in C#7 and C# 8

Learn about latest features of C#7 and C#8
4.3 (424 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
6,595 students enrolled
Created by Dmitri Nesteruk
Last updated 5/2019
English [Auto]
Current price: $34.99 Original price: $49.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 3 hours on-demand video
  • 1 article
  • 18 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Understand and appreciate C#7 and C#8 language features
  • Learn how to use new language features in practice
Course content
Expand all 32 lectures 03:13:47
+ Introduction
1 lecture 02:08

A description of the contents of this course.

Preview 02:08
+ What's New in C# 7
10 lectures 53:15

It used to be the case that, in order to use an out variable, you had to declare it first. Well, not anymore!

Preview 03:09

Not quite the F# pattern-matching on structural types, but it's a start.

Pattern Matching

Better tuples with names and deconstruction. Somewhat ruined by the requirement of an external Nuget package.

Update: System.ValueTuple is now part of .NET Framework 4.7.


What is deconstruction and why should you care?


Functions inside functions, what could be simpler?

Local Functions

References! Just like in C++, except not quite.

Ref Returns and Locals

A community-proposed feature of extending expression bodies to constructors/destructors and getters/setters.

Expression Bodied Members

Throw from a null-coalescing expression? What madness is this?

Throw Expessions

Async method return types are no longer restricted to void/Task/Task<T>.

Preview 03:35

Underscores in decimal, hex and binary literals.

Literal Improvements
+ What's New in C# 7.1
6 lectures 35:14

If you make a new project in Visual Studio 2017.3 and try to use a C#7.1 feature, the project won't compile. Why is that?

Oh, and what happens if your assembly has multiple Main methods, some async and some not?

Preview 02:13

The Main() method can now be marked async and is allowed to return a Task or Task<int>.

Async Main

Watch the default keyword become a literal (similar to the null literal) and start taking on additional responsibilities.

Default Expessions

Learn about assemblies whose method bodies are replaced with throw

Ref Assemblies

Just as the name suggests, this feature allows us, in certain cases, to infer tuple names and lets us omit them.

Infer Tuple Names

C# 7.1 makes it easier to pattern-match against a variable of a generic type.

Preview 03:03
+ What's New in C# 7.2
7 lectures 42:05

You can now put an underscore after a binary (0b) or hexadecimal (0x) literal prefix.

Leading Digit Separators

A new access modifier called 'private protected' was introduced. Learn what it's for and how it is different from 'protected internal'.

'private protected' Access Modifier

Named arguments can now appear before positional ones.

Non-trailing named arguments

Value types can now be passed by reference. What magic is this?

Preview 10:47

Since references to value types are meant to be readonly (otherwise, just pass by value), we have a new 'ref readonly' qualifier.

'ref readonly' Variables

The 'ref struct' feature was designed specifically for Span<T> in mind... shame that the type itself is not yet ready.

'ref struct' and Span<T>

Even though Span<T> is still in prerelease form, let's take a look at it anyway! Its internal mechanics will change, but the public API probably won't.

Span<T> Demo
+ What's New in C# 7.3
4 lectures 15:13

Improvements to C#, related mainly to unsafe memory manipulations.

Performance Improvements

Some minor improvements to existing C# features.

Feature Enhancements

Three new compiler flags!

OOPS: the explanation for -publicsign is incorrect and will be fixed! Sorry!

New Compiler Features

A couple of links to my other .NET/C# courses!

Bonus Lecture: Other Courses at a Discount
+ What's New in C# 8 [BETA]
4 lectures 45:51

Probably the worst, most incorrect name given to a feature, Nullable Reference Types are a new way of generating null-related warnings.

Nullable Reference Types

Two new pieces of syntactic sugar and two new types, Index and Range, help you index into and take parts of collections easier.

Indices and Ranges

A rather controversial feature, default interface members allow you to patch interfaces after deployment with concrete implementations. .NET Core only!

Default Interface Members

Continuing to steal features from F#, pattern matching is now augmented with many useful features.

Preview 09:26
  • Knowledge of C# 6 and earlier

This short course covers the latest and greatest features of C#, covering versions 7, 7.1, 7.2, 7.3 and 8.0 [BETA] of the language that are being sim-shipped with corresponding Visual Studio updates.

Course Topics

Here's every language feature presented in this course, grouped by the version of the C# language.

C# 7:

  • Out Variables

  • Pattern Matching (is and switch expressions)

  • Tuples and Tuple Deconstruction

  • Local Functions

  • Ref Returns and Locals

  • Expression Bodied Members

  • Throw Expressions

  • Generalized Async Return Types

  • Literal Improvements

C# 7.1:

  • How to turn on C# 7.1 support

  • Async Main

  • Default Expressions

  • Ref Assemblies

  • Infer Tuple Names

  • Pattern-Matching with Generics

C# 7.2:

  • Leading Digit Separators

  • 'Private Protected' Access Modifier

  • Non-Trailing Named Arguments

  • Reference Semantics on Value Types:

    • 'In' Parameters

    • 'Ref Readonly' Variables

    • 'Ref Struct' and Span<T>

C# 7.3:

  • Performance improvements

    • Access fixed fields without pinning

    • Reassign ref local variables

    • Use initializers on stackalloc arrays 

    • Use fixed statements on any type that supports a pattern 

  • Enhancements to existing features 

    • Tuple == and != support 

    • Use expression variables in more locations 

    • Attach attributes to backing field of auto-properties 

    • Improved method resolution when arguments differ by 'in' 

    • Improved overload resolution 

  • New compiler options: 

    • deterministic

    • publicsign

    • pathmap

C# 8 [BETA]:

  • Nullable Reference Types

  • Indices and Ranges

  • Default Interface Members

  • Pattern Matching


  • Knowledge and understanding of C# 6 and earlier

  • General experience in .NET/C# application development

Learning Outcomes

  • An understanding and appreciation of latest C# 7/7.1/7.2/7.3/8 language features

  • Understanding of how to convert existing C# code to C# 7/7.1/7.2/7.3/8

Who this course is for:
  • Beginner and experienced .NET/C# developers