Async DbCommand methods
I have been told that the code at the bottom is Targit code.
Is there any plans on using the async methods on the command? Like command.ExecuteReaderAsync ?
That way I could just override those in my custom ADO provider, rather than starting a new Task manually.
public static InMemoryTable genInmemoryTable(
string p_tableName,
DbConnection conn,
string sql,
bool compileTable,
CancellationToken token)
{
Timer delta = new Timer();
if (!InMemoryDatabase.DisableTimers)
delta.start();
DbCommand command = conn.CreateCommand();
command.CommandText = sql;
command.CommandType = CommandType.Text;
command.CommandTimeout = InMemoryDatabase.ImportTimeout;
DbDataReader reader = command.ExecuteReader();
InMemoryTable inMemoryTable = new InMemoryTable(p_tableName, reader, compileTable, token);
reader.Dispose();
command.Dispose();
if (!InMemoryDatabase.DisableTimers)
{
delta.stop();
InMemoryDatabase.loadingTimer.addElapsed(delta);
}
return inMemoryTable;
}
Comments
1 comment