I have a class that implements the interface IPerson
. I wanna call form my class a method implemented in the interface, and I get this error: CS0103 The name 'SayMyName' does not exist in the current context How can I call a method implemented in an interface from a derived class?
public interface IPerson
{
string SayMyName()
{
return "MyName";
}
}
public class Person : IPerson
{
public void Method()
{
SayMyName();//ERROR CS0103 The name 'SayMyName' does not exist in the current context
}
}