C# Nullable reference types – No more null reference exceptions!
Are you tired of null reference exceptions and unexpected crashes due to uninitialized variables? There’s a very handy feature in C# called nullable references types that will help you catch this before it becomes a problem! In this video we are exploring nullable reference types in C#. This is a great addition to the C# language! This language feature was first introduced in C# 8.0 and is a great way to find potential problems, before it becomes an issue! Enable nullable reference types in your project by modifying the csproj file. This video also includes details on how to use the C# 9.0 language features 'new expression' and 'init only setters'. Follow me on Twitter: @fekberg / fekberg Check out my courses on Pluralsight: https://pluralsight.pxf.io/d1MRK Office background by: https://unsplash.com/@sunday_digital Table of contents: 00:00 Introduction 00:33 Why do null reference exceptions occur? 01:14 C# 9.0: 'new expression' 04:29 Nullable Reference Types 05:06 Nullable Reference Type Syntax 05:21 Enable the Nullable Reference Types on the Project level 05:56 Compiler Warnings 06:33 Introducing a Nullable Reference Type 09:07 More Compiler Warnings 09:55 Damn it/Null forgiving operator 12:39 C# 9.0: Init only setters 15:34 Enable the Nullable REference Types using Directives 16:04 Summary DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the links, I may receive a small commission.

Pattern Matching in C#

Coding Shorts: Nullable Reference Types: Or, Why Do I Need to Use the ? So Much!

Working with Null in .NET 6 and C# 10

Manage Nulls Like a Boss and Never Fail!

C# Yield Return: What is it and how does it work?

How to Avoid Null Reference Exceptions: Optional Objects in C#

Correcting Common Async/Await Mistakes in .NET 8 - Brandon Minnick - Copenhagen DevFest 2023

"Clean" Code, Horrible Performance

Records in C#

The worst programming language of all time

Avoid Returning Null From Methods – There Is a Better Way To Write Them!

Interfaces in C# - What they are, how to use them, and why they are so powerful.

C# Full Course : C# Tutorial for Beginners

Learn Dependency Injection in less than 20 minutes! - C# DI - #csharp #dependencyinjection #net

Where are types allocated in .NET and why people get it so wrong

C# Async / Await - Make your app more responsive and faster with asynchronous programming

What is Span in C# and why you should be using it

What are Delegates? (C# Basics, Lambda, Action, Func)

C# Null-Conditional Operator (? Operator) Explained!

