1
Follows the code:
Update command works:
int noOfRowUpdated = ctx.Database.ExecuteSqlCommand("Update Mapa set Geo = geography::Point(47.65100, -122.34900, 4326) where Id= 1");
What does not work is Insert command:
int noOfRowInserted = ctx.Database.ExecuteSqlCommand("INSERT into Mapa(Geo) values('geography::Point(47.65100, -122.34900, 4326)')");
I get that mistake:
A . NET Framework error occurred During Execution of user-defined routine or Aggregate "Geography": System.Formatexception: 24114: the label Geography::Point(47. in the WKT (well-known text) input is not valid. Valid labels are: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION, CIRCULARSTRING, COMPOUNDCURVE, CURVEPOLYGON and FULLGLOBE (Data Type only Geography). System.Formatexception: Microsoft.SqlServer.Types.OpenGisTypes.Parselabel(String input) in Microsoft.SqlServer.Types.WellKnownTextReader.Parsetaggedtext(Opengistype type) in Microsoft.SqlServer.Types.WellKnownTextReader.Read(Opengistype type, Int32 srid) in Microsoft.SqlServer.Types.SqlGeography.Parsetext(Opengistype type, Sqlchars taggedText, Int32 srid) in Microsoft.SqlServer.Types.SqlGeography.Geographyfromtext(Opengistype type, Sqlchars taggedText, Int32 srid) in Microsoft.SqlServer.Types.SqlGeography.Parse(Sqlstring s) . The statement has been terminated.