?? is the operator
null-Merge in the
C#.
Operator ?? is used to set default values for
value types and
reference types, that allow a value null.
Operator ?? Returns
left operand, if left operand
not equal to null.
Otherwise returns
right operand.
C#
int? price = null;
int a = price ?? 45;
// a = 45
int? count = 8;
int b = count ?? 10;
// b = 8