Update Check

This commit is contained in:
sunkaixuan
2023-10-04 19:37:50 +08:00
parent 313d5c0101
commit 2c20e4bbf1
2 changed files with 2 additions and 2 deletions

View File

@@ -208,8 +208,7 @@ namespace SqlSugar
}
private async Task<int> _BulkMerge(List<T> datas, string[] updateColumns, string[] whereColumns)
{
Check.Exception(this.entityInfo.Columns.Any(it => it.IsIdentity || it.OracleSequenceName.HasValue()), "The BulkMerge method cannot be used for increment or sequence", "BulkMerge方法不能用于自增或者序列");
{
Check.Exception(whereColumns == null || whereColumns.Count() == 0, "where columns count=0 or need primary key");
Check.Exception(whereColumns == null || whereColumns.Count() == 0, "where columns count=0 or need primary key");
var isAuto = this.context.CurrentConnectionConfig.IsAutoCloseConnection;

View File

@@ -68,6 +68,7 @@ namespace SqlSugar
public override Task<int> Merge(DataTable dt, EntityInfo entityInfo, string[] whereColumns, string[] updateColumns)
{
Check.Exception(this.entityInfo.Columns.Any(it => it.OracleSequenceName.HasValue()), "The BulkMerge method cannot be used for sequence", "BulkMerge方法不能用序列");
var sqlBuilder = this.Context.Queryable<object>().SqlBuilder;
var insertColumns = entityInfo.Columns
.Where(it => it.IsIgnore == false)