Pomelo.EntityFrameworkCore.MySql MySqlGeometry, EntityframeworkCore Migrations failed

entity-framework-core geometry mysql pomelo-entityframeworkcore-mysql

Question

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.

1
0
12/4/2019 1:44:12 PM

Popular Answer

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.

0
11/30/2019 1:48:54 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow