Good day everyone. I've been using the MySQL API to interact with my MySQL database. The only problem is that the asynchronous methods aren't working.
Example of my code:
private MySqlConnection mySqlConnection;
private async Task OpenConnection() {
//Assign mySqlConnection if null
//Check if mySqlConnection is closed
await mySqlConnection.OpenAsync();
}
private async Task<bool> ExampleMethod() {
try {
await OpenConnection();
return true;
} catch {
return false;
}
}
Whenever I execute ExampleMethod my application pauses until the method has completed its operation. Could someone tell me what could be the problem?
Thanks in advance.