我正在使用来自 System.Data.Entity.Spatial;
和 Entity Framework 的 DbGeography
,与 SQL Server 数据库一起使用。现在我要切换到使用 MySQL 服务器,但是在创建与 DbGeography
类型相关的数据库时出现错误。
我如何解决这个问题而不改变所有域类属性的类型?
public class Place
{
...
public virtual int Id { get; set; }
public string Name { get; set; }
public DbGeography Location {get;set;}
...
}
我遇到的错误是这样的:
System.NotSupportedException: There is no store type corresponding to the EDM type 'Edm.Geography' of primitive type 'Geography'.