-
Notifications
You must be signed in to change notification settings - Fork 752
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
数据库表里所有时间字段,修改为utc时间 #159
Labels
Milestone
Comments
是否使用UTC时间还是应该按项目实际需要进行选择吧,我觉得框架武断引入会增加不少复杂度 |
给实体的DateTime类型属性添加UTC存储支持需求
EFCore中技术支持在实体的EntityConfiguration中,对时间类型的属性添加转换器,如下:
如此,每个实体的配置都要添加转换器,是件繁琐的事,可以通过DI注入解决 DI服务实现方式1. 添加服务接口
2. 服务实现
3. 添加服务在
4. 添加数据上下文配置添加配置选项
5. 在 DbContextBase 的 OnModelCreating 应用服务
|
基于 #212 的改进,对此功能进行重构添加接口
|
gmf520
added a commit
that referenced
this issue
Mar 17, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
您的功能请求与现有问题有关吗?请描述
数据库表的时间字段, 能否修改为UTC时间, 框架如果能统一处理的话就更好了
描述您想要的解决方案
描述你考虑过的替代方案
现在方案也能用, 但如果框架能覆盖该功能的话, 适用更加广泛
附加上下文,比如截图
无
The text was updated successfully, but these errors were encountered: