mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 04:18:16 +08:00
- 修复 MapType 复杂表达式树解析 bug;#1062
This commit is contained in:
@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user