diff --git a/Src/Asp.Net/SqlSugar/Abstract/FastestProvider/FastestProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/FastestProvider/FastestProvider.cs index 80ed70cd6..e5a82bf33 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/FastestProvider/FastestProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/FastestProvider/FastestProvider.cs @@ -109,6 +109,12 @@ namespace SqlSugar Check.ExceptionEasy(this.AsName.IsNullOrEmpty(), "need .AS(tablaeName) ", "需要 .AS(tablaeName) 设置表名"); return BulkUpdateAsync(this.AsName, dataTable, whereColumns, updateColumns).ConfigureAwait(true).GetAwaiter().GetResult(); } + public int BulkUpdate(DataTable dataTable, string[] whereColumns) + { + string[] updateColumns = dataTable.Columns.Cast().Select(it => it.ColumnName).Where(it => !whereColumns.Any(z => z.EqualCase(it))).ToArray(); + Check.ExceptionEasy(this.AsName.IsNullOrEmpty(), "need .AS(tablaeName) ", "需要 .AS(tablaeName) 设置表名"); + return BulkUpdateAsync(this.AsName, dataTable, whereColumns, updateColumns).ConfigureAwait(true).GetAwaiter().GetResult(); + } public async Task BulkUpdateAsync(string tableName, DataTable dataTable, string[] whereColumns, string[] updateColumns) { diff --git a/Src/Asp.Net/SqlSugar/Interface/IFastest.cs b/Src/Asp.Net/SqlSugar/Interface/IFastest.cs index b296be11f..34eac10bc 100644 --- a/Src/Asp.Net/SqlSugar/Interface/IFastest.cs +++ b/Src/Asp.Net/SqlSugar/Interface/IFastest.cs @@ -25,6 +25,7 @@ namespace SqlSugar Task BulkUpdateAsync(List datas, string[] whereColumns, string[] updateColumns); int BulkUpdate(string tableName,DataTable dataTable, string[] whereColumns, string[] updateColumns); int BulkUpdate(DataTable dataTable, string[] whereColumns, string[] updateColumns); + int BulkUpdate(DataTable dataTable, string[] whereColumns); Task BulkUpdateAsync(string tableName, DataTable dataTable, string[] whereColumns, string[] updateColumns); SplitFastest SplitTable(); }