Is it possible to override the null-coalescing operator for a class in C#?
Say for example I want to return a default value if an instance is null and return the instance if it's not. The code would look like something like this:
return instance ?? new MyClass("Default");
But what if I would like to use the null-coalescing operator to also check if the MyClass.MyValue is set?
Of course there is no real need for this (at least I think so) - so before you answer "why would you want to do that" - I am just curious if it's possible.