Class Member Operators Null Conditional Member Access

suggest change
var zipcode = myEmployee?.Address?.ZipCode;
//returns null if the left operand is null.  
//the above is the equivalent of:
var zipcode = (string)null;
if (myEmployee != null && myEmployee.Address != null) {
    zipcode = myEmployee.Address.ZipCode;
}

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents