EF CORE“dotnet ef dbcontext 支架”定义数据类型
我已经搜索网络已经有一段时间了,但是找不到我想要的东西。
基本上,当我针对我的sqlite db运行上述代码时,它会生成所有类等,但是它没有呈现布尔值等,而是选择将它们作为字节[] []创建,并且所有浮点数都以双倍的形式创建。
我不想要这个,因为在对付数学时,双打往往会很差,并且会创造不正确的值。
因此,基本上我想知道的是,是否有一种方法来定义类型的映射。因此,数据库中的所有“真实”都是像Bool一样的十进制和位?
I've been searching the web for a while, but can't find what I'm looking for.
Basically when I run the aforementioned code against my Sqlite DB, it generates all the classes etc, but instead of rendering booleans etc, it chooses to create them as byte[] and all floating point numbers come through as doubles.
I don't want this, as doubles tend to do poorly when doing math against them, and can create incorrect values.
So basically what I want to know, is, is there a way to define the mapping of types. So all "REAL" in the database are created as Decimal and BIT as bool?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论