title: EF6 throws Specified cast is not valid on async method
body: <p>When using <code>await</code> and <code>FirstOrDefaultAsync</code> I get <strong>Specified cast is not valid</strong> exception.</p>
  <pre><code>var a = Db.Table1.SqlQuery(&quot;select * from Table1 where rownum =1 &quot;).FirstOrDefault();
  var b = await Db.Table1.SqlQuery(&quot;select * from Table1 where rownum =1 &quot;).FirstOrDefaultAsync();
  </code></pre>
  <p>so a is fine b throws error. What am I missing?</p>
  <pre><code>   at System.Data.Common.DbDataReader.GetFieldValue[T](Int32 ordinal)
     at System.Data.Common.DbDataReader.GetFieldValueAsync[T](Int32 ordinal, CancellationToken cancellationToken)
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Data.Entity.Core.Objects.Internal.ShapedBufferedDataRecord.&lt;ReadIntAsync&gt;d__25.MoveNext()
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Data.Entity.Utilities.TaskExtensions.CultureAwaiter.GetResult()
     at System.Data.Entity.Core.Objects.Internal.ShapedBufferedDataRecord.&lt;InitializeAsync&gt;d__4.MoveNext()
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Data.Entity.Core.Objects.Internal.BufferedDataReader.&lt;InitializeAsync&gt;d__0.MoveNext()
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Data.Entity.Core.Objects.ObjectContext.&lt;ExecuteStoreQueryInternalAsync&gt;d__73`1.MoveNext()
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Data.Entity.Utilities.TaskExtensions.CultureAwaiter`1.GetResult()
     at System.Data.Entity.Core.Objects.ObjectContext.&lt;ExecuteInTransactionAsync&gt;d__3d`1.MoveNext()
     at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
     at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
     at System.Data.Entity.Utilities.TaskExtensions.CultureAwaiter`1.GetResult()
     at System.Data.Entity.Infrastructure.DbExecutionStrategy.&lt;ProtectedExecuteAsync&gt;d__9`1.MoveNext()
  </code></pre>