[英]Pomelo.EntityFrameworkCore.MySql MySqlGeometry, EntityframeworkCore Migrations failed
This is a simple case of use dotnet-ef migration tool to generate the MySQL database.这是使用 dotnet-ef 迁移工具生成 MySQL 数据库的简单案例。
I have Pomelo.EntityFrameworkCore.MySql as the MySQL DB connector and class property:我有 Pomelo.EntityFrameworkCore.MySql 作为 MySQL DB 连接器和类属性:
public MySqlGeometry Location { get; set; }
The MySqlGeometry datatype supported by Mysql.Data.Types come with Pomelo package. Mysql.Data.Types 支持的 MySqlGeometry 数据类型随 Pomelo 包一起提供。
When I run当我跑
> dotnet ef migrations add InitialCreate
I get the following error:我收到以下错误:
No suitable constructor found for entity type 'MySqlGeometry'.
找不到适合实体类型“MySqlGeometry”的构造函数。 The following constructors had parameters that could not be bound to properties of the entity type: cannot bind 'bytes' in 'MySqlGeometry(byte[] bytes)'.
以下构造函数的参数无法绑定到实体类型的属性:无法绑定“MySqlGeometry(byte[] bytes)”中的“bytes”。
I guess the mysql geometry data type not supported by Pomelo connector?我猜 Pomelo 连接器不支持 mysql 几何数据类型? Or EntityframeworkCore Migrations tools doesn't support the MySQLGeometry data type?
或者 EntityframeworkCore 迁移工具不支持 MySQLGeometry 数据类型? Or I miss any datatype package to support it.
或者我错过了任何支持它的数据类型包。
While MySqlGeometry
is supported by MySqlConnector (the underlying library used by Pomelo), it is not yet supported by Pomelo itself.尽管 MySqlConnector(Pomelo 使用的底层库)支持
MySqlGeometry
,但 Pomelo 本身尚不支持。
We have spatial data type support planned as a feature for the 3.1.0
release.我们计划将空间数据类型支持作为
3.1.0
版本的一项功能。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.