My MySqlConnection class implements IDatabaseConnection interface. In update method, I want to call connect() but it cannot find this method, How can I call it?
class MySqlConnection : IDatabaseConnection
{
void IDatabaseConnection.connect()
{
...
}
void IDatabaseConnection.update()
{
connect(); // here
...
}
}
Apparently you’re using explicit interface implementation, except your syntax is incorrect (you mustn’t specify an access modifier on it).
To call the method, just cast
thistoIDatabaseConnection: