I understand that .NET 4.5 comes with a bunch of features to make asynchronous database operations easier to implement. MSDN says that if the connection string is not set to
I was into the same problem today and I made a Console Application to test whether it's working or not. Seems to me it's not working for my MySQL connector 6.9.4.
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace MySQLTest
{
class Program
{
static void Main(string[] args)
{
Service service = new Service();
var task1 = service.GetCountries("1");
var task2 = service.GetCountries("2");
var task3 = service.GetCountries("3");
Console.WriteLine("bö");
Console.ReadLine();
}
}
public class Service
{
public async Task> GetCountries(string param)
{
Console.WriteLine(String.Format("{0} started.", param));
using (worldEntities context = new worldEntities())
{
Console.WriteLine(String.Format("{0} awaiting.", param));
List countries = await context.country.ToListAsync();
Console.WriteLine(String.Format("{0} done.", param));
return new List();
}
}
}
}
This one outputs,

And When I change List countries = await context.country.ToListAsync();
to await Task.Delay(5000);
it outpus :

after 5 seconds.
So I say it's not supported yet.