What does question mark and dot operator ?. mean in C# 6.0?
It’s the null conditional operator. It basically means: “Evaluate the first operand; if that’s null, stop, with a result of null. Otherwise, evaluate the second operand (as a member access of the first operand).” In your example, the point is that if a is null, then a?.PropertyOfA will evaluate to null rather than throwing an exception – it will then compare that null reference with foo (using string’s == overload), … Read more