Browse Source

Add Check

pull/12/MERGE
sunkaixuan 7 years ago
parent
commit
560983a34a
  1. 1
      Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

1
Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

@ -30,6 +30,7 @@ namespace SqlSugar
PreToSql();
string sql = UpdateBuilder.ToSqlString();
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());
}
public IUpdateable<T> AS(string tableName)

Loading…
Cancel
Save