0

I try to make an OData-API supporting spatial Queries. I build my model, with a database-first approach (from PostGresql) including a PostGIS - Column. It seems to import it correctly, having this in DBContext:

            entity.Property(e => e.Geom)
                .HasColumnName("geom")
                .HasColumnType("geometry(Point,4326)");

And in the model it is like this:

    public Point Geom { get; set; }

So, when making the call the following happens: All the Data are loaded from the Database, but the Geometry has an infinite Loop like this:

Infinite Loop

And i have no idea why it's happening.

Any Advice, how to fix this and where the problem might lie, would be appreciated.

Kind Regards

  • I don't know anything about NetTopology, but if you think this problem is being caused by your Property Geom, you could try explicitly defining the get and set methods. – pseudoabdul May 08 '20 at 09:56
  • hi, i think thats just normal. the coordinatevalue property just returns itself which results in a endless loop when you click through it in the debugger. its not there in the data. – Michael Schönbauer May 13 '20 at 06:53
  • @MichaelSchönbauer The problem is, when returning the set with Odata it also loops in the response JSON....so it's not just there which is the problem. – Kai Dannies May 14 '20 at 07:30
  • after looking more into your screenshot, the Property CoordinateValue of the Geom class looks strange to me. What type is `CoordinateValue` of? Can you post the class? Also, your odata request and metadata.xml? – Michael Schönbauer May 14 '20 at 15:44

0 Answers0