I briefly thought "oh yeah, mixins, shame we can't do that in C# with single inheritance" and then realized that's what extension methods are for (and slightly more general).
I have some C# code which relies on calling an extension method on a null instance, which is mildly naughty but saves a lot of refactoring.
You can call an extension method, because it's just fancy syntax for calling a non member method with the thing before the . as the first argument. If you then don't reference it at all, it doesn't matter that it's null.
I have some C# code which relies on calling an extension method on a null instance, which is mildly naughty but saves a lot of refactoring.