Sorry if the question is not 100% related to SQL Server itself. But I thought it matches the topic close enough to post it here.
I'm using Entity Framework in my ASP.NET Web API project. While creating my POCOs I receive LatLngBounds from the browser client (Google Maps API).
I create a DbGeography (MULTIPOINT) instance from these incoming coordinates that represents my two points to re-create a rectangle.
Now I need the bounding box (polygon) of this MULTIPOINT construct. After some research I thought the STEnvelope function from the SqlGeometry assembly might help on this as I can not find a way to do this with the DbGeography type. Everything looks fine in the code until I try so save the object.
Please see the gist [1] for example code an the error message from EF. See gist [2] for the generated SQL from EF.
Does it make sense to try it this way, or am I missing something important here and there's a much easier way?