Esempio n. 1
0
        private RoamlerDbContext NewContext()
        {
            var db = new RoamlerDbContext();

            db.Configuration.AutoDetectChangesEnabled = false;
            db.Configuration.ProxyCreationEnabled     = false;
            db.Configuration.LazyLoadingEnabled       = false;

            return(db);
        }
Esempio n. 2
0
        // 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));
            }
        }