C# Nullreferenceexception Demystified
Published 2/2025
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 368.89 MB | Duration: 1h 6m
Published 2/2025
MP4 | Video: h264, 1920x1080 | Audio: AAC, 44.1 KHz
Language: English | Size: 368.89 MB | Duration: 1h 6m
Learn principles, features, and strategies to avoid NullReferenceException in less than 1 hour
What you'll learn
Learn when NullReferenceException is thrown
Use C# Nullable Operators to simplify null checks
Identify troublesome code blocks by using Nullable References
Use the Option type to avoid NullReferenceException
Avoid NullReferenceException when working with LINQ XOrDefault methods
Requirements
Know the C# syntax to declare and initialize objects
Write conditionals (such as if, else, and switch) and loops (such as for, while, and foreach)
Work with collections like arrays and lists
Have the latest version of the .NET SDK installed
Description
"Object reference not set to an instance of an object."If you have found that scary exception message, you're not alone.As C# software developers, we all have found it at some point.I've found it dozens of times while working with past employers and clients on codebases of different sizes and complexities.And often when we find it, the only thing we could do is fire up the Visual Studio debugger, go through the code line by line, and inspect all parameters and variables until finding the "object reference not set…" Boring and time-consuming. Arrrggg!That's NullReferenceException in C#.The "Billion-dollar mistake."If you want to get rid of this exception from your code, this is the course for you.Learn principles, features, and strategies to say goodbye to NullReferenceException—in 1 hour and 5 minutes, to be precise.After finishing this course, you will:Understand when NullReferenceException is thrown.Use Nullable Operators to simplify null checks.Work with Nullable References to identify troublesome code blocks.Adopt the Option type as an alternative to Nullable References.Safely use LINQ XOrDefault methods.No expertise required to write code free from the NullReferenceException.You only need to be comfortable declaring and initializing objects and working with conditionals, loops, and collections such as arrays and lists.See you in the first lesson and let's get rid of this exception once and for all.
C# developers who want to write code free from the NullReferenceException,C# developers who want to spend less time debuging their code to fix the NullReferenceException