'No suitable constructor found for entity type 'CoordinateSystem'
I'm trying to generate a migration file with a spatial column in it (Geometry) and I'm getting this error
No suitable constructor found for entity type 'CoordinateSystem'. The following constructors had parameters that could not be bound to properties of the entity type: cannot bind 'epsgId', 'topology' in 'CoordinateSystem(int epsgId, string name, Topology topology)'.
is it because spatial data aren't supported in SQL?
The model that I'm trying to add to database:
public class Polygon
{
public int Id { set; get; }
public int AreaId { set; get; }
[ForeignKey("AreaId")]
public virtual Area Area { get; set; }
public Geometry Border { get; set; }
[Column(TypeName = "nvarchar(7)")]
public string Color { get; set; }
public DateTime SelectDate { get; set; }
}
Solution 1:[1]
Your Polygon.cs file needs to be using
Geometry
from NetTopologySuite.Geometries
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Ced |