“The null conditional operator prevents the execution of a method if the caller object is null.“
Explaination:
Whether you are novice or experienced developer you must be familiar with null reference exceptions. You must be tired of writing null checking code to make sure your application handles null references correctly. The null-conditional operator is going to save you from writing lots of null checking code. In this article I am going to explain the usage of null-conditional operator with the help of an example.
if the s.city is blank then we write like as follow
if (s.city != null){
lblCity.Text = s.city.name;
}
but we can avoid check if condition by using null condition operator as follow
lblCity.Text = s.city?.name;
for more information click here.