- 修复 IUpdate.Set(a => a.xx = null) 表达式解析 bug;#311

This commit is contained in:
28810
2020-05-15 13:27:44 +08:00
parent 2a3febdad5
commit 0991464fd0
19 changed files with 130 additions and 36 deletions

View File

@ -148,6 +148,9 @@ namespace FreeSql.Tests.Odbc.MySql
sql = update.Set(a => a.Id == 10).Where(a => a.Id == 1).ToSql().Replace("\r\n", "");
Assert.Equal("UPDATE `tb_topic` SET `Id` = 10 WHERE (`Id` = 1)", sql);
sql = update.Set(a => a.Clicks == null).Where(a => a.Id == 1).ToSql().Replace("\r\n", "");
Assert.Equal("UPDATE `tb_topic` SET `Clicks` = NULL WHERE (`Id` = 1)", sql);
var id = g.mysql.Insert<TestEnumUpdateTb>().AppendData(new TestEnumUpdateTb { type = TestEnumUpdateTbType.sum211 }).ExecuteIdentity();
Assert.True(id > 0);
sql = g.mysql.Update<TestEnumUpdateTb>().Where(a => a.id == id).Set(a => a.type, TestEnumUpdateTbType.biggit).ToSql().Replace("\r\n", "");