Nullable reference types were introduced in C# 8.0 with DotNet Core 3.0
This is a new feature of the C# programming language and helps the developer to handle the null reference exception at the compile time.
Null Reference Exception occurs at the run time but with the help of nullable reference type the compiler will throw a warning at the compile time.
The main purpose of nullable reference type is to avoid assigning null to reference type. As per this concept, the reference type in C# should have a non-nullable value.
To enable nullable reference type in Dotnet core project we need to add a tag nullable with enable/disable value.
Nullable reference type will work on all reference types example - property, field, object, etc.
In this video, you will this new feature (nullable reference type) of C# 8 and can avoid the null reference exception completely.
Chapters
0:00 Introduction to Nullable Reference Type in C#
05:00 Enable the Nullable Reference Type in DotNet Core Project
06:05 Nullable Reference Type with Object
08:28 Nullable Reference Type with Properties
11:40 Nullable Reference Type with Methods
13:42 Enable/Disable Nullable Reference Type only in one file
#nullablereferencetype #advancedprogramming #nitishkaushik #whatsnewincsharp #latestfeatures #csharp
LIKE, SUBSCRIBE & SHARE this video ✌✌✌.