No. The closest you can find is probably related to the null design of the object:
(logger ?? NullLogger.Instance).Log(message);
where NullLogger.Instance is a Logger that just does not handle all of its methods. (Of course, if you want the default behavior to do something, not no-op-ing, you can replace the appropriate Logger.Default or something else instead of NullLogger.Instance.)
source
share