5 C# Evolutions You May Not Know

1. Safe Navigation Operator ( ? Operator):
The ? operator was introduced with .NET 2.0, with the nullable types that allow variables to have null as a value or to not have one at all. We can test it with the HasValue property.In C# 6, Microsoft added a new feature to this operator (?) called safe navigation operator.
It’s so simple and so useful, let me explain it with an example. We access a child property or method via the navigation operator “." but if you try to navigate into a null variable you will have the famous NullReferenceException. So we must test before accessing or calling any method on this object like this : 

Link: https://dzone.com/articles/5-c-evolutions-you-may-not-know?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev