From 84657feb814f4f882b71bceecf5017df15fcb129 Mon Sep 17 00:00:00 2001 From: liulun <412588801@qq.com> Date: Sat, 9 Jun 2018 18:34:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=BA=86=E4=B8=AA?= =?UTF-8?q?=E4=BB=A4=E4=BA=BA=E8=9B=8B=E8=9B=8B=E5=8F=91=E7=96=BC=E7=9A=84?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Abstract/UpdateProvider/UpdateableProvider.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs index a159bdc25..e18f31196 100644 --- a/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs +++ b/Src/Asp.NetCore2/SqlSeverTest/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs @@ -67,6 +67,16 @@ namespace SqlSugar this.Context.MappingTables.Add(entityName, tableName); return this; ; } + + public IUpdateable IgnoreColumns(bool IgnoreAllNullColumns, bool IsOffIdentity = false) + { + UpdateBuilder.IsOffIdentity = IsOffIdentity; + if (this.UpdateBuilder.LambdaExpressions == null) + this.UpdateBuilder.LambdaExpressions = InstanceFactory.GetLambdaExpressions(this.Context.CurrentConnectionConfig); + this.UpdateBuilder.IsNoUpdateNull = IgnoreAllNullColumns; + return this; + } + public IUpdateable IgnoreColumns(Func ignoreColumMethod) { this.UpdateBuilder.DbColumnInfoList = this.UpdateBuilder.DbColumnInfoList.Where(it => !ignoreColumMethod(it.PropertyName)).ToList(); @@ -181,6 +191,7 @@ namespace SqlSugar return this; } + [Obsolete] public IUpdateable Where(bool isUpdateNull, bool IsOffIdentity = false) { UpdateBuilder.IsOffIdentity = IsOffIdentity; @@ -189,6 +200,7 @@ namespace SqlSugar this.UpdateBuilder.IsNoUpdateNull = isUpdateNull; return this; } + public IUpdateable Where(Expression> expression) { var expResult = UpdateBuilder.GetExpressionValue(expression, ResolveExpressType.WhereSingle);