It essentially means
if name is not null
set name to name
else
if data is null
set name to null
else
set name to data.name
The second operator (?.
) avoids a NullReferenceException
by returning null instead of trying to use the access modifier. The first (??
) returns the first operand if the value is not null, otherwise it returns the second.
Note that neither of these are specific to dynamic
or Azure.
It could also have been written as
if ((name == null) && (data != null))
{
name = data.name;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…