mono/mono — pull request #628 by pdonald (2013-05-03 12:16:29+00:00)
Title: Implemented async methods in System.Data.Common

Previously these methods were marked with a `MonoTODO` attribute and threw a `NotImplementedException`.

These methods are implemented like in .NET. For example, `DbConnection.OpenAsync`:

> This is the asynchronous version of Open. Providers should override with an appropriate implementation. The cancellation token can optionally be honored.The default implementation invokes the synchronous Open call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by Open will be communicated via the returned Task Exception property.Do not invoke other methods and properties of the DbConnection object until the returned Task is complete.

These non-existing async methods didn't magically become asynchronous, they run synchronously, but now it's possible to use them even though providers haven't implemented them yet.

Consider this piece of code:

using (var db = new MySqlConnection()) {
await db.OpenAsync();
}

This code will be executed synchronously but if the provider implements it in the future, we can use that feature without changing any code.