This commit is contained in:
sunkaixuan
2017-09-15 15:04:18 +08:00
parent fef5049e24
commit 00c64dd9f3
2 changed files with 3 additions and 3 deletions

View File

@@ -28,9 +28,9 @@ namespace SqlSugar
public int ExecuteCommand() public int ExecuteCommand()
{ {
PreToSql(); PreToSql();
Check.Exception(UpdateBuilder.WhereValues.IsNullOrEmpty() && GetPrimaryKeys().IsNullOrEmpty(), "You cannot have no primary key and no conditions");
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 Task<int> ExecuteCommandAsync() public Task<int> ExecuteCommandAsync()

View File

@@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("4.5.2.0")] [assembly: AssemblyVersion("4.5.2.1")]
[assembly: AssemblyFileVersion("4.5.2.0")] [assembly: AssemblyFileVersion("4.5.2.1")]