From 3f5291de7fe9d7ecb6c424097e79150b210cbe91 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sat, 20 May 2017 18:48:14 +0800 Subject: [PATCH] - --- .../Abstract/Core/SqlBuilder/DMLBuilder/UpdateBuilder.cs | 1 + SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/SqlSugar/Abstract/Core/SqlBuilder/DMLBuilder/UpdateBuilder.cs b/SqlSugar/Abstract/Core/SqlBuilder/DMLBuilder/UpdateBuilder.cs index d2efc3a3b..6b059ba5b 100644 --- a/SqlSugar/Abstract/Core/SqlBuilder/DMLBuilder/UpdateBuilder.cs +++ b/SqlSugar/Abstract/Core/SqlBuilder/DMLBuilder/UpdateBuilder.cs @@ -22,6 +22,7 @@ namespace SqlSugar public string TableName { get; set; } public string TableWithString { get; set; } public List DbColumnInfoList { get; set; } + public List WhereValues { get; set; } public List> SetValues { get; set; } public bool IsUpdateNull { get; set; } public bool IsReturnIdentity { get; set; } diff --git a/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs b/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs index 889c0cf8a..d7da2ef7c 100644 --- a/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs +++ b/SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs @@ -50,7 +50,8 @@ namespace SqlSugar public KeyValuePair> ToSql() { - return new KeyValuePair>(); + string sql = UpdateBuilder.ToSqlString(); + return new KeyValuePair>(sql, UpdateBuilder.Parameters); } public IUpdateable Update(T InsertObj) @@ -76,6 +77,8 @@ namespace SqlSugar } public IUpdateable Where(Expression> expression) { + var expResult = UpdateBuilder.GetExpressionValue(expression, ResolveExpressType.WhereSingle); + UpdateBuilder.WhereValues.Add(expResult.GetResultString()); return this; } public IUpdateable With(string lockString)