C# 8.0 Nullable References
Use C# 8.0 nullable references to signal a possible NullReferenceException.
To prevent a NullReferenceException
, we should check and defend against null
. The real question is when an object reference might be null
and therefore when we should add a null
check. That’s precisely what C# 8.0 solves with the nullable references feature.
Get hands-on with 1400+ tech skills courses.