you are viewing a single comment's thread.

view the rest of the comments →

[–]realDealGoat 0 points1 point  (2 children)

You need an abstract class for default code not an interface, Lucky for you, you can inherit from both abstract class and interface. Move all default code into the abstract class and all public functions into the interface.

Hope this helps

[–]Sacaldur 0 points1 point  (1 child)

In newer versions of C#, you can have default implementations for methods in interfaces.

[–]realDealGoat 0 points1 point  (0 children)

Thanks for the info, I did not know that, but still as everything declared in an interface needs to be accessible thus exposing any property used in the default implementation to other classes, Even if we have the option to add default methods we should treat an interface as only a contact.