// HACK: Build index on first attempt to resolve it private static ISpatialIndex BuildIndex(IComponentContext c) { using (var db = new RoamlerDbContext()) { var builder = c.Resolve<ISpatialIndexBuilder>(); var locations = db.Locations.Take(100000); return builder.BuildIndex(locations); } }
public LocationRepository(RoamlerDbContext dbContext) { _dbContext = dbContext; }
private RoamlerDbContext NewContext() { var db = new RoamlerDbContext(); db.Configuration.AutoDetectChangesEnabled = false; db.Configuration.ProxyCreationEnabled = false; db.Configuration.LazyLoadingEnabled = false; return db; }