Manipulating Entity Framework sql query

527 views Asked by At

Is there any way to manipulate the entity framework query.

I have a class that has a geometry column.

public class Geom
{
    public Guid Id { get; set; }
    public string Name { get; set; }
    public string Geometry { get; set; }
}

Database context is getting data from database.

        using (var database = new DatabaseContext())
        {
            var items= database.Geoms;
        }

This sends database an sql query like: "select id,name,geometry from geoms"

I want to change the query before send database like this:

 "select id,name,ST_AsText(geometry) from geoms"

is this possible?

Because I am using postgresql database so can not use DbGeometry.

0

There are 0 answers