Follow 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 this error:
The .NET Framework error occurred during execution of user-defined routine or aggregate "geography": System.FormatException: 24114: o geography :: Point (47) in the WKT (well-known text) entry is not valid. Valid labels are: POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION, CIRCULARSTRING, COMPOUNDCURVE, CURVEPOLYGON, and FULLGLOBE (Data Type Only geography). System.FormatException: in 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.