mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-04-24 18:04:52 +08:00
Code optimization
This commit is contained in:
parent
d858510bc2
commit
5a049b308a
@ -302,7 +302,7 @@ namespace SqlSugar
|
||||
|
||||
public IUpdateable<T> Where(Expression<Func<T, bool>> expression)
|
||||
{
|
||||
Check.Exception(UpdateObjs.Length > 1, ErrorMessage.GetThrowMessage("insert List no support where","集合插入不支持Where请使用WhereColumns"));
|
||||
Check.Exception(UpdateObjs.Length > 1, ErrorMessage.GetThrowMessage("update List no support where","集合更新不支持Where请使用WhereColumns"));
|
||||
var expResult = UpdateBuilder.GetExpressionValue(expression, ResolveExpressType.WhereSingle);
|
||||
var whereString = expResult.GetResultString();
|
||||
if (expression.ToString().Contains("Subqueryable()"))
|
||||
@ -314,7 +314,7 @@ namespace SqlSugar
|
||||
}
|
||||
public IUpdateable<T> Where(string whereSql, object parameters = null)
|
||||
{
|
||||
Check.Exception(UpdateObjs.Length > 1, ErrorMessage.GetThrowMessage("insert List no support where", "集合插入不支持Where请使用WhereColumns"));
|
||||
Check.Exception(UpdateObjs.Length > 1, ErrorMessage.GetThrowMessage("update List no support where", "集合更新不支持Where请使用WhereColumns"));
|
||||
if (whereSql.HasValue())
|
||||
{
|
||||
UpdateBuilder.WhereValues.Add(whereSql);
|
||||
@ -327,7 +327,7 @@ namespace SqlSugar
|
||||
}
|
||||
public IUpdateable<T> Where(string fieldName, string conditionalType, object fieldValue)
|
||||
{
|
||||
Check.Exception(UpdateObjs.Length > 1, ErrorMessage.GetThrowMessage("insert List no support where", "集合插入不支持Where请使用WhereColumns"));
|
||||
Check.Exception(UpdateObjs.Length > 1, ErrorMessage.GetThrowMessage("update List no support where", "集合更新不支持Where请使用WhereColumns"));
|
||||
var whereSql = this.SqlBuilder.GetWhere(fieldName, conditionalType, 0);
|
||||
this.Where(whereSql);
|
||||
string parameterName = this.SqlBuilder.SqlParameterKeyWord + fieldName + "0";
|
||||
|
Loading…
Reference in New Issue
Block a user