C#C
C#17mo ago
Tom

✅ Methods (with bodies) in interfaces

Hi!
C# allows interfaces to contain methods already with some implementation (i.e. with body).
As I can easily think about taking advantage of this, but doesn't it deny the main reason interfaces exists - i.e. to abstract things?
If it were your decision whould you use this functionality in your project or stick only to other options (like putting logic inside abstract classes, using services, etc.)?
Was this page helpful?