shuxinqin / Chloe

A lightweight and high-performance Object/Relational Mapping(ORM) library for .NET --C#
https://github.com/shuxinqin/Chloe/wiki
MIT License
1.52k stars 455 forks source link

PostgreSql执行Update操作时间计算使用变量时触发异常 #259

Closed wxk0248 closed 3 years ago

wxk0248 commented 3 years ago

using (var db = CreateDBContext()) { int temp = 2; db.Update<DataDictionary>(p => p.Name == "测试类型", t => new DataDictionary { UpdateTime = t.CreateTime.AddDays(temp) }); } Chloe.Exceptions.ChloeException:“An exception occurred while executing DbCommand. For details please see the inner exception. 42883: function make_interval(days => numeric) does not exist”

shuxinqin commented 3 years ago

看不出问题在哪

wxk0248 commented 3 years ago

看不出问题在哪

更新日期类型字段时候使用了DateTime的.AddDays()方法,使用常量也就是AddDays(1)可以正常更新,但是使用传入的变量AddDays(temp)就报这个异常了。PostgreSql版本号13.3

shuxinqin commented 3 years ago

Chloe.PostgreSQL v4.16.1 已修复。

wxk0248 commented 3 years ago

已升级,十分感谢!