mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-19 01:58:13 +08:00
Add Check
This commit is contained in:
@@ -30,6 +30,7 @@ namespace SqlSugar
|
|||||||
PreToSql();
|
PreToSql();
|
||||||
string sql = UpdateBuilder.ToSqlString();
|
string sql = UpdateBuilder.ToSqlString();
|
||||||
RestoreMapping();
|
RestoreMapping();
|
||||||
|
Check.Exception(UpdateBuilder.WhereValues.IsNullOrEmpty() && GetPrimaryKeys().IsNullOrEmpty(), "You cannot have no primary key and no conditions");
|
||||||
return this.Ado.ExecuteCommand(sql, UpdateBuilder.Parameters == null ? null : UpdateBuilder.Parameters.ToArray());
|
return this.Ado.ExecuteCommand(sql, UpdateBuilder.Parameters == null ? null : UpdateBuilder.Parameters.ToArray());
|
||||||
}
|
}
|
||||||
public IUpdateable<T> AS(string tableName)
|
public IUpdateable<T> AS(string tableName)
|
||||||
|
Reference in New Issue
Block a user