diff --git a/Projects/Dotmim.Sync.Core/Orchestrators/BaseOrchestrator.Conflicts.cs b/Projects/Dotmim.Sync.Core/Orchestrators/BaseOrchestrator.Conflicts.cs index b0e911de..40aab12a 100644 --- a/Projects/Dotmim.Sync.Core/Orchestrators/BaseOrchestrator.Conflicts.cs +++ b/Projects/Dotmim.Sync.Core/Orchestrators/BaseOrchestrator.Conflicts.cs @@ -259,7 +259,7 @@ internal SyncConflict InternalGetConflict(SyncContext context, SyncRow remoteCon using var dataReader = await command.ExecuteReaderAsync().ConfigureAwait(false); - if (!dataReader.Read()) + if (!await dataReader.ReadAsync()) { dataReader.Close(); command.Dispose(); diff --git a/Projects/Dotmim.Sync.Core/Orchestrators/GetChanges/BaseOrchestrator.GetChanges.cs b/Projects/Dotmim.Sync.Core/Orchestrators/GetChanges/BaseOrchestrator.GetChanges.cs index 669a802f..c1d5500b 100644 --- a/Projects/Dotmim.Sync.Core/Orchestrators/GetChanges/BaseOrchestrator.GetChanges.cs +++ b/Projects/Dotmim.Sync.Core/Orchestrators/GetChanges/BaseOrchestrator.GetChanges.cs @@ -220,7 +220,7 @@ await schemaTables.ForEachAsync(async syncTable => // Get the reader using var dataReader = await args.Command.ExecuteReaderAsync().ConfigureAwait(false); - while (dataReader.Read()) + while (await dataReader.ReadAsync()) { // Create a row from dataReader var syncRow = CreateSyncRowFromReader(context, dataReader, schemaChangesTable); @@ -438,7 +438,7 @@ await scopeInfo.Schema.Tables.ForEachAsync(async syncTable => // Get the reader using var dataReader = await args.Command.ExecuteReaderAsync().ConfigureAwait(false); - while (dataReader.Read()) + while (await dataReader.ReadAsync()) { bool isTombstone = false; for (var i = 0; i < dataReader.FieldCount; i++) diff --git a/Projects/Dotmim.Sync.Core/Orchestrators/Scopes/BaseOrchestrator.ScopeInfoClients.cs b/Projects/Dotmim.Sync.Core/Orchestrators/Scopes/BaseOrchestrator.ScopeInfoClients.cs index 4690985b..d7604a3a 100644 --- a/Projects/Dotmim.Sync.Core/Orchestrators/Scopes/BaseOrchestrator.ScopeInfoClients.cs +++ b/Projects/Dotmim.Sync.Core/Orchestrators/Scopes/BaseOrchestrator.ScopeInfoClients.cs @@ -171,7 +171,7 @@ await this.InternalCreateScopeInfoTableAsync(context, DbScopeType.ScopeInfoClien ScopeInfoClient scopeInfoClient = null; - if (reader.Read()) + if (await reader.ReadAsync()) scopeInfoClient = InternalReadScopeInfoClient(reader); reader.Close(); @@ -209,7 +209,7 @@ internal virtual async Task> InternalLoadAllScopeInfoClien using DbDataReader reader = await command.ExecuteReaderAsync().ConfigureAwait(false); - while (reader.Read()) + while (await reader.ReadAsync()) { var scopeInfoClient = InternalReadScopeInfoClient(reader); @@ -264,7 +264,7 @@ internal virtual async Task> InternalLoadAllScopeInfoClien using DbDataReader reader = await command.ExecuteReaderAsync().ConfigureAwait(false); - reader.Read(); + await reader.ReadAsync(); var newScopeInfoClient = InternalReadScopeInfoClient(reader); diff --git a/Projects/Dotmim.Sync.Core/Orchestrators/Scopes/BaseOrchestrator.ScopeInfos.cs b/Projects/Dotmim.Sync.Core/Orchestrators/Scopes/BaseOrchestrator.ScopeInfos.cs index cc4890ec..4e300a65 100644 --- a/Projects/Dotmim.Sync.Core/Orchestrators/Scopes/BaseOrchestrator.ScopeInfos.cs +++ b/Projects/Dotmim.Sync.Core/Orchestrators/Scopes/BaseOrchestrator.ScopeInfos.cs @@ -206,7 +206,7 @@ await this.InternalCreateScopeInfoTableAsync(context, DbScopeType.ScopeInfo, ScopeInfo scopeInfo = null; - if (reader.Read()) + if (await reader.ReadAsync()) scopeInfo = InternalReadScopeInfo(reader); reader.Close(); @@ -289,7 +289,7 @@ await this.InternalCreateScopeInfoTableAsync(context, DbScopeType.ScopeInfo, using DbDataReader reader = await command.ExecuteReaderAsync().ConfigureAwait(false); - while (reader.Read()) + while (await reader.ReadAsync()) { var scopeInfo = InternalReadScopeInfo(reader); @@ -348,7 +348,7 @@ await this.InternalCreateScopeInfoTableAsync(context, DbScopeType.ScopeInfo, using DbDataReader reader = await action.Command.ExecuteReaderAsync().ConfigureAwait(false); - reader.Read(); + await reader.ReadAsync(); scopeInfo = InternalReadScopeInfo(reader); diff --git a/Projects/Dotmim.Sync.MySql/MySqlManagementUtils.cs b/Projects/Dotmim.Sync.MySql/MySqlManagementUtils.cs index 164b754f..1584bfdb 100644 --- a/Projects/Dotmim.Sync.MySql/MySqlManagementUtils.cs +++ b/Projects/Dotmim.Sync.MySql/MySqlManagementUtils.cs @@ -56,7 +56,7 @@ public static class MySqlManagementUtils { if (reader.HasRows) { - reader.Read(); + await reader.ReadAsync(); dbName = reader.GetString(0); dbVersion = reader.GetString(1); } @@ -88,7 +88,7 @@ public static async Task GetAllTablesAsync(MySqlConnection connection using (var reader = await mySqlCommand.ExecuteReaderAsync().ConfigureAwait(false)) { - while (reader.Read()) + while (await reader.ReadAsync()) { var tableName = reader.GetString(0); var setupTable = new SetupTable(tableName); diff --git a/Projects/Dotmim.Sync.PostgreSql/NpgsqlManagementUtils.cs b/Projects/Dotmim.Sync.PostgreSql/NpgsqlManagementUtils.cs index ba77e68d..6259e5b2 100644 --- a/Projects/Dotmim.Sync.PostgreSql/NpgsqlManagementUtils.cs +++ b/Projects/Dotmim.Sync.PostgreSql/NpgsqlManagementUtils.cs @@ -190,7 +190,7 @@ where lower(table_type) = 'base table' using (var reader = await NpgsqlCommand.ExecuteReaderAsync().ConfigureAwait(false)) { - while (reader.Read()) + while (await reader.ReadAsync()) { var tableName = reader.GetString(0); var schemaName = reader.GetString(1); @@ -305,7 +305,7 @@ from information_schema.columns { if (reader.HasRows) { - reader.Read(); + await reader.ReadAsync(); dbVersion = reader.GetString(0); dbName = reader.GetString(1); diff --git a/Projects/Dotmim.Sync.SqlServer/SqlManagementUtils.cs b/Projects/Dotmim.Sync.SqlServer/SqlManagementUtils.cs index 2ff94f78..d8bcf8b8 100644 --- a/Projects/Dotmim.Sync.SqlServer/SqlManagementUtils.cs +++ b/Projects/Dotmim.Sync.SqlServer/SqlManagementUtils.cs @@ -39,7 +39,7 @@ public static async Task GetAllTablesAsync(SqlConnection connection, using (var reader = await sqlCommand.ExecuteReaderAsync().ConfigureAwait(false)) { - while (reader.Read()) + while (await reader.ReadAsync()) { var tableName = reader.GetString(0); var schemaName = reader.GetString(1) == "dbo" ? null : reader.GetString(1); @@ -546,7 +546,7 @@ public static async Task IsChangeTrackingEnabledAsync(SqlConnection connec { if (reader.HasRows) { - reader.Read(); + await reader.ReadAsync(); dbName = reader.GetString(0); dbVersion = reader.GetString(1); diff --git a/Projects/Dotmim.Sync.SqlServer/SqlSyncAdapter.Batch.cs b/Projects/Dotmim.Sync.SqlServer/SqlSyncAdapter.Batch.cs index 61646b44..a0953f84 100644 --- a/Projects/Dotmim.Sync.SqlServer/SqlSyncAdapter.Batch.cs +++ b/Projects/Dotmim.Sync.SqlServer/SqlSyncAdapter.Batch.cs @@ -92,7 +92,7 @@ public override async Task ExecuteBatchCommandAsync(SyncContext context, DbComma using var dataReader = await cmd.ExecuteReaderAsync().ConfigureAwait(false); - while (dataReader.Read()) + while (await dataReader.ReadAsync()) { var failedRow = new SyncRow(schemaChangesTable, syncRowState); diff --git a/Projects/Dotmim.Sync.Sqlite/SQLiteManagementUtils.cs b/Projects/Dotmim.Sync.Sqlite/SQLiteManagementUtils.cs index 11bd7ffc..f5550d4f 100644 --- a/Projects/Dotmim.Sync.Sqlite/SQLiteManagementUtils.cs +++ b/Projects/Dotmim.Sync.Sqlite/SQLiteManagementUtils.cs @@ -34,7 +34,7 @@ public static async Task GetAllTablesAsync(SqliteConnection connectio using (var reader = await sqlCommand.ExecuteReaderAsync().ConfigureAwait(false)) { - while (reader.Read()) + while (await reader.ReadAsync()) { var tableName = reader.GetString(0); var setupTable = new SetupTable(tableName);