简体   繁体   中英

Pomelo.EntityFrameworkCore.MySql MySqlGeometry, EntityframeworkCore Migrations failed

This is a simple case of use dotnet-ef migration tool to generate the MySQL database.

I have Pomelo.EntityFrameworkCore.MySql as the MySQL DB connector and class property:

public MySqlGeometry Location { get; set; }

The MySqlGeometry datatype supported by Mysql.Data.Types come with Pomelo package.

When I run

> dotnet ef migrations add InitialCreate

I get the following error:

No suitable constructor found for entity type 'MySqlGeometry'. The following constructors had parameters that could not be bound to properties of the entity type: cannot bind 'bytes' in 'MySqlGeometry(byte[] bytes)'.

I guess the mysql geometry data type not supported by Pomelo connector? Or EntityframeworkCore Migrations tools doesn't support the MySQLGeometry data type? 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.

We have spatial data type support planned as a feature for the 3.1.0 release.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM