diff --git a/OrmTest/UnitTest/Update.cs b/OrmTest/UnitTest/Update.cs index c95eb9d58..541829f98 100644 --- a/OrmTest/UnitTest/Update.cs +++ b/OrmTest/UnitTest/Update.cs @@ -47,11 +47,15 @@ namespace OrmTest.UnitTest .UpdateColumns(it => new { it.Name }).ToSql(); //update List - var s8 = db.Updateable(updateObj).With(SqlWith.UpdLock).ToSql(); + var s8 = db.Updateable(updateObjs).With(SqlWith.UpdLock).ToSql(); //Re Set Value var s9 = db.Updateable(updateObj) .ReSetValue(it=>it.Name==(it.SchoolId+"")).ToSql(); + + //Where By Expression + var s10 = db.Updateable(updateObj) + .Where(it => it.Id==1).ToSql(); } public SqlSugarClient GetInstance() diff --git a/SqlSugar/Interface/IUpdateable.cs b/SqlSugar/Interface/IUpdateable.cs index cdd935e91..8eeac9ea7 100644 --- a/SqlSugar/Interface/IUpdateable.cs +++ b/SqlSugar/Interface/IUpdateable.cs @@ -13,11 +13,13 @@ namespace SqlSugar IUpdateable With(string lockString); IUpdateable Update(T InsertObj); IUpdateable Where(bool isUpdateNull); + IUpdateable Where(Expression> expression); IUpdateable UpdateColumns(Expression> columns); IUpdateable IgnoreColumns(Expression> columns); IUpdateable IgnoreColumns(Func ignoreColumMethod); IUpdateable ReSetValue(Expression> setValueExpression); IUpdateable UpdateRange(List InsertObjs); KeyValuePair> ToSql(); + object Where(Func p); } }