To increase my page performance I wanted to run a few queries asynchronously.
I upgraded to EF6 because it natively supports this feature by exposing async methods.
I couldn't get the queries to fire simultaneously so i boiled my code down to this simple example :
var sw = new Stopwatch(); sw.Start(); var dummy = context.Set<CA_Event_Person>().Take(200).ToListAsync(); sw.Stop(); Logger.Debug("attempt nr 1 : " + sw.ElapsedMilliseconds); var result = await dummy;
My exception was that the stopwatch with instantly stop since i'm doing the await at a later point.
My logger however says that 5000 milliseconds have passed on the stopwatch meaning the call was performed synchronous instead of asynchronous.
Anyone got some insight in the why or what i could be doing wrong?