- 修复 MapType 复杂表达式树解析 bug;#1062

This commit is contained in:
2881099
2022-03-31 16:29:01 +08:00
parent 69c74590f4
commit 198e027c48
2 changed files with 25 additions and 2 deletions

View File

@ -16,6 +16,27 @@ namespace FreeSql.Tests
{
public class UnitTest5
{
// DTO
public class TestDto
{
public decimal ratio { get; set; }
public bool is_lock { get; set; }
}
[Fact]
public void TestDoubleWhereBug()
{
var fsql = g.mysql;
// 测试例子
var test = new TestDto();
test.ratio = 2.1M;
var sql = fsql.Update<TestDto>().Set(m => new TestDto
{
is_lock = test.ratio < 1 //这里生成的SQL语句有问题 ratio = 0.9 或 1.9 或 2.1 等等都是生成的是1
}).Where(m => test.ratio < 1).ToSql();
Assert.Equal(@"UPDATE TestDto SET is_lock = 2.1 < 1
WHERE (2.1 < 1)", sql);
}
[Fact]
public void TestLambdaParameterWhereIn()
{