为什么这两个"真正的"和"浮动"被映射到"单" ;?双"而非&QUOT这两个、而非、QUOT

2023-09-04 01:06:33 作者:等无此人

我使用System.Data.SQLite 1.0.90与VS2013和的EntityFramework 5型号优先模式(= EDMX)。

I am using System.Data.SQLite 1.0.90 with VS2013 and EntityFramework 5 in Model-First mode (=EDMX).

我创建了一个包含表的新SQLite数据库:

I created a new SQLite database containing a table:

CREATE TABLE [..]
  [Test1integer] integer,
  [Test2int] int,
  [Test3smallint] smallint,
  [Test4tinyint] tinyint,
  [Test5bigint] bigint,
  [Test6money] money,
  [Test7float] float,
  [Test8real] real,
  [Test9decimal] decimal,
  [Test10numeric18_5] numeric(18,5), [..]

有关的部分是 Test7float Test8real

已经执行后的更新型号从数据库... 的EDMX现在包含这样的:

After having executed Update Model from Database... the EDMX now contains this:

      <Property Name="Test1integer" Type="integer" />
      <Property Name="Test2int" Type="int" />
      <Property Name="Test3smallint" Type="smallint" />
      <Property Name="Test4tinyint" Type="tinyint" />
      <Property Name="Test5bigint" Type="integer" />
      <Property Name="Test6money" Type="decimal" Precision="53" Scale="0" />
      <Property Name="Test7float" Type="real" />
      <Property Name="Test8real" Type="real" />
      <Property Name="Test9decimal" Type="decimal" Precision="53" Scale="0" />
      <Property Name="Test10numeric18_5" Type="decimal" Precision="18" Scale="5" />

有关的部分是 Test7float Test8real

      <Property Name="Test1integer" Type="Int64" />
      <Property Name="Test2int" Type="Int32" />
      <Property Name="Test3smallint" Type="Int16" />
      <Property Name="Test4tinyint" Type="Byte" />
      <Property Name="Test5bigint" Type="Int64" />
      <Property Name="Test6money" Type="Decimal" Precision="53" Scale="0" />
      <Property Name="Test7float" Type="Single" />
      <Property Name="Test8real" Type="Single" />
      <Property Name="Test9decimal" Type="Decimal" Precision="53" Scale="0" />
      <Property Name="Test10numeric18_5" Type="Decimal" Precision="18" Scale="5" />

有关的部分是 Test7float Test8real

Test7float 错误地变成了真正的+单 - 和设计师也不允许双师型这里

Test7float wrongly became "real" + "Single" -- and the designer also does not allow "Double" here.

在sqlite3的文档( http://www.sqlite.org/datatype3.html )明确规定,真实是一个8字节的IEEE浮点数和浮动只是一个代名词真实 - 所以在任何情况下双(8字节)应pferred过单身$ P $ (4字节)。

The SQLite3 docs ( http://www.sqlite.org/datatype3.html ) clearly state that "real" is a 8-byte IEEE floating point number and "float" is only a synonym for "real" -- so in every case "Double" (8 byte) should be preferred over "Single" (4 byte).

我是不是做错了什么,或我误解的东西吗?如果不是哪儿?事情出错,我该如何解决这些问题。

Am I doing something wrong or did I misunderstand something? If not: Where are things going wrong and how can I fix them?

我要创造这样的错误报告?

Should I create a bug report for this?

推荐答案

皇家sqllite数据类型实际上是一个浮点数(的 http://www.sqlite.org/datatype3.html )和通讯员.NET Framework类型是单人(的 http://msdn.microsoft.com/en-us/library/b1e65aza.aspx )

Real sqllite data type is actually a float (http://www.sqlite.org/datatype3.html) and the correspondant .Net framework type is Single (http://msdn.microsoft.com/en-us/library/b1e65aza.aspx)