Spatial DbGeography Provider exception with Effort.EF6 [No usable spatial provider could be found.]

asp.net-mvc c# effort entity-framework-6 spatial

Accepted Answer

Given that DbGeography and other specialized attributes are not supported by Effort, and Tamasflamich reports here:

There is no existing support (not even beta) and I am not planning to start work on this feature anytime soon. Sorry.

Additionally, I attempted to utilize Highway.Data, but it is not supported.

It does not now, nor will it ever support AdvancedQuery, AdvancedCommand, or AdvancedScalar.

I examined my code and realized I just needed the locations inside a box. I therefore made the decision to quit utilizing DbGeography and complete the task on my own, as seen below:

public class Place
{
  public int Id { get; set; }
  public string Name { get; set; }
  public double Lat { get; set; }
  public double Lng { get; set; }
}

in place of

public IEnumerable<Church> GetInBox(DbGeography boundingBox)
{
  return All().Where(c => c.Location.Intersects(boundingBox));
}

I now have this

public IEnumerable<Church> GetInBox(DbGeography boundingBox)
{
  All().Where(c =>
            c.Lat <= nelt &&
            c.Lat >= swlt &&
            c.Lng <= nelng &&
            c.Lng >= swlng
            );
}

My issue was now resolved, but it would be wonderful if Effort and HighwayFramework supported spatial.

2
3/5/2015 9:32:57 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow