Inheritance: System.Web.HttpApplication
        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);
            }
        }