@@ -22,7 +22,7 @@ public ClickhouseIssueTest(ITestOutputHelper output)
2222 _fsql = new FreeSqlBuilder ( ) . UseConnectionString ( DataType . ClickHouse ,
2323 "Host=192.168.1.123;Port=8123;Database=test_issue;Compress=True;Min Pool Size=1" )
2424 . UseMonitorCommand ( cmd => _output . WriteLine ( $ "线程:{ cmd . CommandText } \r \n ") )
25- . UseNoneCommandParameter ( false )
25+ . UseNoneCommandParameter ( true )
2626 . UseAdoConnectionPool ( true )
2727 . Build ( ) ;
2828 }
@@ -45,22 +45,25 @@ public void TestIssue1813()
4545 {
4646 Id = "9cd7af52-85cc-4d26-898a-4020cadb0491" ,
4747 Name = "update_name1" ,
48- UpdateTime = DateTime . Now
48+ UpdateTime = DateTime . Now ,
49+ CreateTime = DateTime . Parse ( "2024-05-30 10:01:02" )
4950 } ) ;
5051
5152 updatePerson . Add ( new Person
5253 {
5354 Id = "bd9f9ed6-bd03-4675-abb4-12b7fdac7678" ,
5455 Name = "update_name2" ,
55- UpdateTime = DateTime . Now
56+ UpdateTime = DateTime . Now ,
57+ CreateTime = DateTime . Parse ( "2024-05-30 10:01:02" )
5658 } ) ;
5759
58- _fsql . Update < Person > ( ) . SetSource ( updatePerson ) . UpdateColumns ( person => new
59- {
60- person . Name ,
61- person . UpdateTime ,
62- } ) . ExecuteAffrows ( ) ;
63-
60+ var sql = _fsql . Update < Person > ( ) . SetSource ( updatePerson )
61+ . UpdateColumns ( person => new
62+ {
63+ person . Name ,
64+ person . UpdateTime ,
65+ person . CreateTime
66+ } ) . ToSql ( ) ;
6467 }
6568
6669 [ Fact ]
@@ -94,6 +97,7 @@ public void TestIssue1813CodeFirst()
9497
9598 var insertMany = _fsql . Insert ( persons ) . ExecuteAffrows ( ) ;
9699 }
100+
97101 [ Fact ]
98102 public void TestIssue1813CodeFirst2 ( )
99103 {
@@ -130,11 +134,11 @@ public void TestIssue1813CodeFirst2()
130134 }
131135
132136
133-
134137 public class Person
135138 {
136139 [ Column ( IsPrimary = true , IsIdentity = true ) ]
137140 public string Id { get ; set ; }
141+
138142 public string Name { get ; set ; }
139143 public int Age { get ; set ; }
140144 public DateTime CreateTime { get ; set ; }
0 commit comments