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

Rafy ORM Sql Server 中 DateTime 类型的字段溢出的问题 #101

Open
xujianshe opened this issue Aug 30, 2017 · 6 comments
Open

Rafy ORM Sql Server 中 DateTime 类型的字段溢出的问题 #101

xujianshe opened this issue Aug 30, 2017 · 6 comments

Comments

@xujianshe
Copy link

现在框架在sqlserver数据库下生成的日期类型是DateTime, 但是此类型支持的时间范围是 1753年至9999年, 有些业务日期溢出了此时间范围,希望能够提供对DateTime2类型的定制以支持更广泛的时间。

@zgynhqf zgynhqf changed the title Rafy ORM Sql Server生成DateTime 类型定制问题 Rafy ORM Sql Server 中 DateTime 类型的字段溢出的问题 Aug 30, 2017
@zgynhqf zgynhqf added the bug label Aug 30, 2017
@dyancl1024
Copy link
Contributor

预计9月18号完成

@zgynhqf
Copy link
Owner

zgynhqf commented Sep 16, 2017

给力。

@zgynhqf
Copy link
Owner

zgynhqf commented Sep 16, 2017

qq 20170916121917
.net 中对应的 CLR 类型就是 DateTime,所以不需要修改实体的属性的类型,只要支持实体的 DateTime 类型的属性映射到数据库中时映射为 DateTime2 类型即可。

@zgynhqf zgynhqf added the doing label Sep 16, 2017
@dyancl1024
Copy link
Contributor

提交了

@dyancl1024
Copy link
Contributor

考虑到CLR没有DateTime2类型,但是有DateTimeOffset类型也能满足精度问题
详细见 http://www.studyofnet.com/news/1050.html
接下来改为支持DateTimeOffset

@dyancl1024
Copy link
Contributor

代码已提交

zgynhqf pushed a commit that referenced this issue Dec 16, 2017
)

* 添加对DateTimeOffset类型的支持
修改DbTypeConverter.IsCompatible方法

* 规范代码

* 修改测试兼容SqlCE
dyancl1024 added a commit to dyancl1024/Rafy that referenced this issue Dec 28, 2017
处理Rafy ORM Sql Server 中 DateTime 类型的字段溢出的问题 zgynhqf#101 和无法生成实体注释到数据库 zgynhqf#66 (#…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants