How to convert data type System.Data.Entity.Spatial.DbGeography to C #?

2

My table in DB named SqlSpatialType is as follows:

IDCliente int
Nombre Varchar
GpsLocation Geography
EuclideanaLocation  Geometry

My form

and I want to insert records using EntityFrameworK from C #, The problem I have is how to transform the length and latitude entered by the client ... into the correct data type

protected void Button1_Click(object sender, EventArgs e)
    {
        EMCEntities1 Modelo = new EMCEntities1();
        using (Modelo)
        {
            SqlSpatialType Location = new SqlSpatialType();
            Location.Nombre= txtName.Text;

            // AQUI MI PROBLEMA
            Location .GpsLocation = ? ;
            Location.EuclideanaLocation= ? ;

            Modelo.SqlSpatialType.Add(Location);
            Modelo.SaveChanges();
        }
    }
    
asked by Efrain Mejias C 09.11.2016 в 14:15
source