diff --git a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteFastBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteFastBuilder.cs index aec40db65..8ffe51b0e 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteFastBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteFastBuilder.cs @@ -78,8 +78,11 @@ namespace SqlSugar { if (this.Context?.CurrentConnectionConfig?.MoreSettings?.IsCorrectErrorSqlParameterName == true) { - cmd.CommandText = this.Context.Insertable(dictionary.First()).AS(dt.TableName).ToSqlString().Replace(";SELECT LAST_INSERT_ROWID();", ""); - i += await cmd.ExecuteNonQueryAsync(); + foreach (var item in dictionary) + { + cmd.CommandText = this.Context.Insertable(item).AS(dt.TableName).ToSqlString().Replace(";SELECT LAST_INSERT_ROWID();", ""); + i += await cmd.ExecuteNonQueryAsync(); + } } else { @@ -114,11 +117,14 @@ namespace SqlSugar { if (this.Context?.CurrentConnectionConfig?.MoreSettings?.IsCorrectErrorSqlParameterName == true) { - cmd.CommandText = this.Context.Updateable(dictionary.First()) - .WhereColumns(whereColums) - .UpdateColumns(updateColums) - .AS(dt.TableName).ToSqlString(); - i += await cmd.ExecuteNonQueryAsync(); + foreach (var item in dictionary) + { + cmd.CommandText = this.Context.Updateable(item) + .WhereColumns(whereColums) + .UpdateColumns(updateColums) + .AS(dt.TableName).ToSqlString(); + i += await cmd.ExecuteNonQueryAsync(); + } } else { @@ -151,6 +157,7 @@ namespace SqlSugar } return i; } + private static void Open(SQLiteConnection cn) { if (cn.State != ConnectionState.Open)