Top "Null-conditional-operator" questions

A Safe navigation operator which is used to test for null before performing a member access (?.) or index (?[]) operation.

C# elegant way to check if a property's property is null

In C#, say that you want to pull a value off of PropertyC in this example and ObjectA, PropertyA and …

c# nullreferenceexception nullable null-conditional-operator
C# Safe navigation operator - what is actually going on?

I've been following the safe navigation operator feature added in C#6 with some interest. I've been looking forward to it …

c# c#-6.0 null-conditional-operator
Using the null-conditional operator on the left-hand side of an assignment

I have a few pages, each with a property named Data. On another page I'm setting this data like this: …

c# null-conditional-operator
Using null-conditional bool? in if statement

Why this code works: if (list?.Any() == true) but this code doesn't: if (list?.Any()) saying Error CS0266 Cannot implicitly …

c# c#-6.0 null-conditional-operator
Use null-conditional operator to set value to 0 if null

I'm new to C# but not to programming in general. I am trying to set add some error checking to …

c# null-conditional-operator
Trying to understand ?. (null-conditional) operator in C#

I have this very simple example: class Program { class A { public bool B; } static void Main() { System.Collections.ArrayList list = …

c# nullable roslyn c#-6.0 null-conditional-operator