상속: System.Web.HttpApplication
예제 #1
0
        public static void ConfigureRaven(MvcApplication application)
        {
            var store = new EmbeddableDocumentStore
                                {
                                    DataDirectory = "~/App_Data/Database",
                                    UseEmbeddedHttpServer = true
                                };

            store.Initialize();
            MvcApplication.DocumentStore = store;

            IndexCreation.CreateIndexes(typeof(MvcApplication).Assembly, store);

            var statistics = store.DatabaseCommands.GetStatistics();

            if (statistics.CountOfDocuments < 5)
                using (var bulkInsert = store.BulkInsert())
                    LoadRestaurants(application.Server.MapPath("~/App_Data/Restaurants.csv"), bulkInsert);
        }
예제 #2
0
        public static void ConfigureRaven(MvcApplication application)
        {
            var store = new EmbeddableDocumentStore
                                {
                                    DataDirectory = "~/App_Data/Database",
                                    UseEmbeddedHttpServer = true
                                };

            store.Conventions.CustomizeJsonSerializer = x => x.Converters.Add(new GeoJsonConverter());
            store.Initialize();
            MvcApplication.DocumentStore = store;

            store.ExecuteIndex(new RestaurantIndex());
            store.ExecuteTransformer(new RestaurantsTransformer());

            var statistics = store.DatabaseCommands.GetStatistics();

            if (statistics.CountOfDocuments < 5)
                using (var bulkInsert = store.BulkInsert())
                    LoadRestaurants(application.Server.MapPath("~/App_Data/Restaurants.csv"), bulkInsert);
        }
예제 #3
0
        public static void ConfigureRaven(MvcApplication application)
        {
            var store = new EmbeddableDocumentStore
            {
                DataDirectory         = "~/App_Data/Database",
                UseEmbeddedHttpServer = true
            };

            store.Conventions.CustomizeJsonSerializer = x => x.Converters.Add(new GeoJsonConverter());
            store.Initialize();
            MvcApplication.DocumentStore = store;

            store.ExecuteIndex(new RestaurantIndex());
            store.ExecuteTransformer(new RestaurantsTransformer());

            var statistics = store.DatabaseCommands.GetStatistics();

            if (statistics.CountOfDocuments < 5)
            {
                using (var bulkInsert = store.BulkInsert())
                    LoadRestaurants(application.Server.MapPath("~/App_Data/Restaurants.csv"), bulkInsert);
            }
        }