Created
May 18, 2016 12:49
-
-
Save matthewrwilton/b46596c362d13f692bbf2890df362ee4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<T> ExecuteReaderAsync<T>(string sql, Func<DbDataReader, T> readAction) | |
{ | |
return await _pool.ExecuteAsync(_connectionString, async connection => | |
{ | |
using (var command = new OdbcCommand(sql, connection)) | |
{ | |
var dataReader = await command.ExecuteReaderAsync(); | |
return readAction(dataReader); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment