|
@ -32,6 +32,7 @@ namespace SqlSugar |
|
|
} |
|
|
} |
|
|
private string _ExecuteCommand() |
|
|
private string _ExecuteCommand() |
|
|
{ |
|
|
{ |
|
|
|
|
|
CheckWhere(); |
|
|
PreToSql(); |
|
|
PreToSql(); |
|
|
AutoRemoveDataCache(); |
|
|
AutoRemoveDataCache(); |
|
|
Check.Exception(UpdateBuilder.WhereValues.IsNullOrEmpty() && GetPrimaryKeys().IsNullOrEmpty(), "You cannot have no primary key and no conditions"); |
|
|
Check.Exception(UpdateBuilder.WhereValues.IsNullOrEmpty() && GetPrimaryKeys().IsNullOrEmpty(), "You cannot have no primary key and no conditions"); |
|
@ -42,6 +43,14 @@ namespace SqlSugar |
|
|
return sql; |
|
|
return sql; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void CheckWhere() |
|
|
|
|
|
{ |
|
|
|
|
|
if (UpdateParameterIsNull && UpdateBuilder.WhereValues.IsNullOrEmpty()) |
|
|
|
|
|
{ |
|
|
|
|
|
Check.ExceptionEasy("Update requires conditions", "更新需要条件 Where"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private void _WhereColumn(string columnName) |
|
|
private void _WhereColumn(string columnName) |
|
|
{ |
|
|
{ |
|
|
var columnInfos = columns.Where(it => it.DbColumnName.Equals(columnName, StringComparison.OrdinalIgnoreCase) || it.PropertyName.Equals(columnName, StringComparison.OrdinalIgnoreCase)).ToList(); |
|
|
var columnInfos = columns.Where(it => it.DbColumnName.Equals(columnName, StringComparison.OrdinalIgnoreCase) || it.PropertyName.Equals(columnName, StringComparison.OrdinalIgnoreCase)).ToList(); |
|
|