Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Async all the way #477

Merged
merged 1 commit into from
Jul 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions RepoDb.Core/RepoDb/Operations/DbConnection/Insert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -730,12 +730,12 @@ internal async static Task<TResult> InsertAsyncInternalBase<TEntity, TResult>(th
context.ParametersSetterFunc(command, entity);

// Actual Execution
result = Converter.ToType<TResult>(command.ExecuteScalar());
result = Converter.ToType<TResult>(await command.ExecuteScalarAsync());

// Get explicity if needed
if (Equals(result, default(TResult)) == true && dbSetting.IsMultiStatementExecutable == false)
{
result = Converter.ToType<TResult>(connection.GetDbHelper().GetScopeIdentity(connection, transaction));
result = Converter.ToType<TResult>(await connection.GetDbHelper().GetScopeIdentityAsync(connection, transaction));
}

// Set the return value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ internal static async Task<int> BulkDeleteAsyncInternal(SqlConnection connection
try
{
// Get the DB Fields
var dbFields = DbFieldCache.Get(connection, tableName, transaction, true);
var dbFields = await DbFieldCache.GetAsync(connection, tableName, transaction, true);

// Variables needed
var primaryDbField = dbFields?.FirstOrDefault(dbField => dbField.IsPrimary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1735,11 +1735,11 @@ internal static async Task<int> BulkInsertAsyncInternal(SqlConnection connection
await connection.EnsureOpenAsync();
if (rowState.HasValue == true)
{
sqlBulkCopy.WriteToServer(dataTable, rowState.Value);
await sqlBulkCopy.WriteToServerAsync(dataTable, rowState.Value);
}
else
{
sqlBulkCopy.WriteToServer(dataTable);
await sqlBulkCopy.WriteToServerAsync(dataTable);
}

// Check if this is with pseudo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,7 @@ internal static async Task<int> BulkDeleteAsyncInternal(SqlConnection connection
try
{
// Get the DB Fields
var dbFields = DbFieldCache.Get(connection, tableName, transaction, true);
var dbFields = await DbFieldCache.GetAsync(connection, tableName, transaction, true);

// Variables needed
var primaryDbField = dbFields?.FirstOrDefault(dbField => dbField.IsPrimary);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1751,11 +1751,11 @@ internal static async Task<int> BulkInsertAsyncInternal(SqlConnection connection
await connection.EnsureOpenAsync();
if (rowState.HasValue == true)
{
sqlBulkCopy.WriteToServer(dataTable, rowState.Value);
await sqlBulkCopy.WriteToServerAsync(dataTable, rowState.Value);
}
else
{
sqlBulkCopy.WriteToServer(dataTable);
await sqlBulkCopy.WriteToServerAsync(dataTable);
}

// Check if this is with pseudo
Expand Down