コード例 #1
0
ファイル: DbInitializer.cs プロジェクト: clapis/roamler
        private RoamlerDbContext NewContext()
        {
            var db = new RoamlerDbContext();

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

            return(db);
        }
コード例 #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));
            }
        }