Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Elanis committed Oct 13, 2019
1 parent dd35da9 commit d200453
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Dysnomia.Common.SQL/DbHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public static void BindParameters(IDataParameterCollection parameters, Dictionar
}
}

public static Task<IDataReader> ExecStoredProcedure(IDbConnection connection, string procName, Dictionary<string, object> parameters = null) {
public async static Task<IDataReader> ExecStoredProcedure(IDbConnection connection, string procName, Dictionary<string, object> parameters = null) {
using (IDbCommand command = connection.CreateCommand()) {
command.CommandType = CommandType.StoredProcedure;
command.CommandText = procName;
Expand All @@ -44,11 +44,11 @@ public static Task<IDataReader> ExecStoredProcedure(IDbConnection connection, st

BindParameters(command.Parameters, parameters);

return Task.Run(() => command.ExecuteReader());
return await Task.Run(() => command.ExecuteReader());
}
}

public static Task<IDataReader> ExecSelect(IDbConnection connection, string sqlStatement, Dictionary<string, object> parameters = null) {
public async static Task<IDataReader> ExecSelect(IDbConnection connection, string sqlStatement, Dictionary<string, object> parameters = null) {
using (IDbCommand command = connection.CreateCommand()) {
command.CommandType = CommandType.Text;
command.CommandText = sqlStatement;
Expand All @@ -57,11 +57,11 @@ public static Task<IDataReader> ExecSelect(IDbConnection connection, string sqlS

BindParameters(command.Parameters, parameters);

return Task.Run(() => command.ExecuteReader());
return await Task.Run(() => command.ExecuteReader());
}
}

public static Task<int> ExecStatement(IDbConnection connection, string sqlStatement, Dictionary<string, object> parameters = null) {
public async static Task<int> ExecStatement(IDbConnection connection, string sqlStatement, Dictionary<string, object> parameters = null) {
using (IDbCommand command = connection.CreateCommand()) {
command.CommandType = CommandType.Text;
command.CommandText = sqlStatement;
Expand All @@ -70,7 +70,7 @@ public static Task<int> ExecStatement(IDbConnection connection, string sqlStatem

BindParameters(command.Parameters, parameters);

return Task.Run(() => command.ExecuteNonQuery());
return await Task.Run(() => command.ExecuteNonQuery());
}
}
}
Expand Down

0 comments on commit d200453

Please sign in to comment.