diff --git a/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs index c1c05d099..dcbd922c3 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs @@ -203,12 +203,14 @@ namespace SqlSugar ThrowUpdateByExpression(); if (this.UpdateObjs.HasValue()) { + var oldColumns = this.UpdateBuilder.DbColumnInfoList.Select(it => it.PropertyName).ToList(); var expression = (LambdaExpression.Lambda(method).Body as LambdaExpression).Body; Check.Exception(!(expression is MethodCallExpression), method.ToString() + " is not method"); var callExpresion = expression as MethodCallExpression; UtilMethods.DataInoveByExpresson(this.UpdateObjs, callExpresion); this.UpdateBuilder.DbColumnInfoList = new List(); Init(); + this.UpdateBuilder.DbColumnInfoList = this.UpdateBuilder.DbColumnInfoList.Where(it => oldColumns.Contains(it.PropertyName)).ToList(); } return this; }