UpdateColumns Bug

This commit is contained in:
sunkaixuan 2019-01-01 22:31:23 +08:00
parent ccb4622202
commit a83f70ad33
2 changed files with 2 additions and 1 deletions

View File

@ -121,7 +121,7 @@ namespace OrmTest.Demo
var t26 = db.Updateable(new List<Student>() { new Student() { }, new Student() { } }).UpdateColumns(it => new { it.Name, it.CreateTime }).WhereColumns(it => it.CreateTime).ExecuteCommand();
db.Updateable<Student>().UpdateColumns(it => new Student { SchoolId = GeneratePassword(2, 1), Name =it.Name+1, CreateTime = DateTime.Now.AddDays(1) }).Where(it => it.Id == 1).ExecuteCommand();
db.Updateable<Student>().UpdateColumns(it => new Student { SchoolId = GeneratePassword(2, 1), Name =SqlFunc.ToString(it.Name), CreateTime = DateTime.Now.AddDays(1) }).Where(it => it.Id == 1).ExecuteCommand();
}
private static int GeneratePassword(int v1, int v2)

View File

@ -60,6 +60,7 @@ namespace SqlSugar
string fieldName = string.Empty;
switch (parameter.Context.ResolveType)
{
case ResolveExpressType.Update:
case ResolveExpressType.SelectSingle:
fieldName = GetSingleName(parameter, expression, isLeft);
if (isSetTempData)