Tagged Questions
5
votes
10answers
837 views
Property-coalescing operator for C#
The null-coalescing operator in c# allows you to shorten the code
if (_mywidget == null)
return new Widget();
else
return _mywidget;
Down to:
return _mywidget ?? new Widget();
I ...