Class Member Operators C# with Example



Class Member Operators C# with Example

Member Access 
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; 

0 Comment's

Comment Form

Submit Comment