问题描述
我想知道,在 EntityFramework 6 和 EFCore 3.1 中是否有任何自定义脚手架的方法,例如SQLServer date
将变为 NodaTime.LocalDate
,SQLServer datetime
(或 datetime2
)将转换为 NodaTime.Instant
?
如果是这样 - 谁能给我一个例子怎么做?
我在这里找到了类似的东西:Entity Framework Core - Customise Scaffolding,但我找不到与类型相关的代码编写的任何特定内容。
解决方法
这已在 https://github.com/dotnet/efcore/issues/20114
中讨论过建议使用 EFCore.SqlServer.NodaTime 库。