Skip to content

Conversation

ocdi
Copy link
Contributor

@ocdi ocdi commented Apr 23, 2014

The default provider services doesn't have implementation for spatial services, without these any spatial queries fail. This is based on some work on the old github repo and extended to support selecting with spatial filters and returning spatial objects.

without these any spatial queries fail
@yellis
Copy link
Member

yellis commented Apr 23, 2014

Can you give an example of how this would be used?

What are GetService() and GetServices() for and why do they need to be public?

@ocdi
Copy link
Contributor Author

ocdi commented Apr 23, 2014

This patch is based on work from this SamSaffron/MiniProfiler#100

There is a post I made that was linked from there, however the page now returns a 404 (http://community.miniprofiler.com/permalinks/36/the-provider-did-not-return-a-dbspatialservices-instance)

To be honest I am not sure about the GetService() / GetServices(), but I figured since I was implementing overrides I would just complete the lot. I don't know if they are even being hit, but it is just calling _tail's version, which is the underlying DbProviderServices as far as I can see, so should enhance the overall behavour.

@yellis
Copy link
Member

yellis commented Apr 23, 2014

The new link for that post is here.

@ocdi
Copy link
Contributor Author

ocdi commented Apr 23, 2014

Thanks for the new link - as you can see from that thread the two scenarios this fixes are the Where bit and the Select bit when the MiniProfiler EF6 is enabled:

public IQueryable<DbGeometry> GetWithin(DbGeometry geometry, int limit)
{
    return _dbContext.Features.Where(x => x.PolygonShape.Intersects(geometry))
        .Select(x => x.PolygonShape).Take(limit);
}

@yellis yellis merged commit 8a868fe into MiniProfiler:master Apr 27, 2014
@yellis
Copy link
Member

yellis commented Apr 27, 2014

This is included in MiniProfiler.EF6 3.0.10-beta5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants