default interface member
A method with a body declared on an interface itself, inherited by every implementing class that does not replace it.
In more detail
Implementing classes may still provide their own version, which then takes precedence. It lets you widen a published interface without breaking classes that already implement it, such as adding bool Exists(Guid id) => Get(id) is not null.
Related terms
- interface — A named set of member signatures that a type promises to implement, with no state of its own.
Taught in
- Classes, Interfaces, and Object-Oriented C# — Modern .NET Core, C# & Enterprise Microservices