In Javascript I can do this:
var myVar = returnNull() || new MyObject();
In C# I am currenly doing this:
var myVar = returnObjec
Use the null coalescing operator
var myVar = returnObjectOrNull(); myVar = myVar ?? new MyObject();