-
Notifications
You must be signed in to change notification settings - Fork 861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xugu虚谷数据库date类型字段映射错误 #1942
Comments
fsql.Ado.AuditDataReader += (s, e) => { //debugger 一下 e.GetValue(x) |
{ value值不正确 |
DateTime类型的列可以正常映射,Date类型的不可以 |
date 就用 string 映射吧 |
可以研究一下 TypeHandler 文档,定义一个专属类型和 date 映射也可以的。 class XuguDate } |
试了试用string映射也不行 |
class Student /// 出生日期 /// [Description("出生日期")] [Column(Name = "CSRQ", DbType = "date")] public DateOnly Csrq { get; set; } } class DateOnlyTypeHandler : TypeHandler FreeSql.Internal.Utils.TypeHandlers.TryAdd(typeof(DateOnly), new DateOnlyTypeHandler()); 是这样写吗?没效果呢 |
数据库实际是什么类型? |
date |
如果方便就提供一个 .net demo + xugu 远程环境 |
问题描述及重现代码:
代码中使用DbType标记类型为date,映射查询出来统一为当前时间,并不是数据库保存的出生日期信息
数据库版本
xugu11
安装的Nuget包
FreeSql.All 3.5.101
.net framework/. net core? 及具体版本
.Net8
The text was updated successfully, but these errors were encountered: