Browse Source

-

pull/12/MERGE
sunkaixuan 8 years ago
parent
commit
3f5291de7f
  1. 1
      SqlSugar/Abstract/Core/SqlBuilder/DMLBuilder/UpdateBuilder.cs
  2. 5
      SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

1
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<DbColumnInfo> DbColumnInfoList { get; set; }
public List<string> WhereValues { get; set; }
public List<KeyValuePair<string, string>> SetValues { get; set; }
public bool IsUpdateNull { get; set; }
public bool IsReturnIdentity { get; set; }

5
SqlSugar/Abstract/UpdateProvider/UpdateableProvider.cs

@ -50,7 +50,8 @@ namespace SqlSugar
public KeyValuePair<string, List<SugarParameter>> ToSql()
{
return new KeyValuePair<string, List<SugarParameter>>();
string sql = UpdateBuilder.ToSqlString();
return new KeyValuePair<string, List<SugarParameter>>(sql, UpdateBuilder.Parameters);
}
public IUpdateable<T> Update(T InsertObj)
@ -76,6 +77,8 @@ namespace SqlSugar
}
public IUpdateable<T> Where(Expression<Func<T, bool>> expression)
{
var expResult = UpdateBuilder.GetExpressionValue(expression, ResolveExpressType.WhereSingle);
UpdateBuilder.WhereValues.Add(expResult.GetResultString());
return this;
}
public IUpdateable<T> With(string lockString)

Loading…
Cancel
Save