Null-coalescing assignment operator ??=
02/20/2020
The Operator
One of the new C# features is the null-coalescing assignment operator: ??=
. It assigns the value of its right-hand operand to the left-hand operand if the left-hand operand is null.In other words:
if(myfield == null) myfield = new object();
can be replaced with