How I Learned to Love Default Implementations in C# 8.0
I originally thought that default implementtions in C# 8.0 were a bad idea, but a little digging and I think I love them.
How I Learned to Love Default Implementations in C# 8.0
I originally thought that default implementtions in C# 8.0 were a bad idea, but a little digging and I think I love them.
Francois Nel
Your explanation of default implementations still does not convince me that it is a good feature to start using. Using your example, I would much rather suggest the use of extension methods for LogInfo and LogError than using this “dirty” new feature. In fact, introducing LogInfo and LogError on the interface it self is a bad design in the first place. And I’m afraid this new feature wil promote even more bad designs like this.
Tomer W
Agree, furthermore, if in a specific project you really mean to have those specific implementations, derive from ILogger with an abstract class (say LoggerBase) that implement what you think is common and inject that!