✅ Default interface methods - Am I using them wrong?

I'm trying to learn when/where to properly use interfaces, and I don't understand why my default method doesn't work.

I have this:
c#
public interface IMyInterface {
    string Name { get; set; }
    string JobTitle { get; set; }
    
    void Foo() { Console.WriteLine("Default Foo"); }
}

public class Person {
    public string Name { get; set; }
}

public class Employee : Person, IMyInterface {
    public string JobTitle { get; set; }
}


Creating a new instance of Employee should give me access to employee.Foo(), but it doesn't.

Maybe I'm just overlooking something simple, but I don't understand :/
Was this page helpful?