Open lastlink opened 8 years ago
If you change the EFDataReader.GetValue()
method to this, it works, at least in SQL Server (though it breaks the provider architecture - the translation from DbGeo**
to SqlGeo**
should happen somewhere else):
public override object GetValue(int ordinal)
{
object value = Accessors[ordinal](Enumerator.Current);
var dbgeo = value as DbGeography;
if (dbgeo != null)
{
var chars = new SqlChars(dbgeo.WellKnownValue.WellKnownText);
return SqlGeography.STGeomFromText(chars, dbgeo.CoordinateSystemId);
}
var dbgeom = value as DbGeometry;
if (dbgeom != null)
{
var chars = new SqlChars(dbgeom.WellKnownValue.WellKnownText);
return SqlGeometry.STGeomFromText(chars, dbgeom.CoordinateSystemId);
}
return value;
}
@MikaelEliasson - BTW, happy to throw together a patch for the current active version. I took a look at the V2 you're working on, and it looks like it might be a while before a patch landed there would be helpful.
Bulk insert of lat/long as a 'DbGeography' type throws an error. Is this just not supported?