Skip to content
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

DateOnly and TimeOnly Support Postgresql #1868

Closed
FatTigerWang opened this issue Aug 8, 2024 · 7 comments
Closed

DateOnly and TimeOnly Support Postgresql #1868

FatTigerWang opened this issue Aug 8, 2024 · 7 comments

Comments

@FatTigerWang
Copy link

Feature 特性

// c# code

简要描述原因

目前看起来DateOnly和TimeOnly仅支持MSSQL Server, 希望能够增加对postgresql的支持, 或者有什么方法能够进行自定义的类型处理

使用场景

// c# code
@FatTigerWang
Copy link
Author

已经看到preview版本,非常感谢。

@FatTigerWang
Copy link
Author

存储时没问题,但是查询时报异常:
ExpressionTree 转换类型错误,值(10:00:00),类型(System.TimeSpan),目标类型(System.TimeOnly),Object must implement IConvertible.

@FatTigerWang
Copy link
Author

用的是最新的preview版本3.5.100-preview20240815

@2881099
Copy link
Collaborator

2881099 commented Aug 17, 2024

npgsql.dll 目前的版本改动较大,升级会造成 Could not load type 'Npgsql.TypeHandling.NpgsqlTypeHandlerFactory`1' from assembly 'Npgsql,

低版本,又报错:Can't write CLR type System.TimeOnly with handler type TimeHandler

@FatTigerWang
Copy link
Author

现在问题还蛮严重的,因为貌似没有方法能够绕过,哪怕我用string去映射。除非更改数据库字段类型。

@2881099
Copy link
Collaborator

2881099 commented Aug 17, 2024

他已经改变了传统ado.net使用习惯,进退两难

@2881099
Copy link
Collaborator

2881099 commented Aug 21, 2024

v3.5.100-preview20240821 已解决该问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants