static IDocumentStore CreateDocumentStore()
        {
            var path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            path = Path.Combine(path, Conventions.RavenDataDirectory);
            var populate =  !Directory.Exists(path);

            var documentStore = new EmbeddableDocumentStore () {
                DataDirectory = path
            }.Initialize ();

            if (populate) documentStore.PopulateAll();

            //documentStore.DatabaseCommands.EnsureDatabaseExists (Conventions.RavenDatabase);

            return documentStore;
        }
Exemple #2
0
        /// <summary>
        /// Creates the document store.
        /// </summary>
        /// <returns>
        /// The document store.
        /// </returns>
        private static IDocumentStore CreateDocumentStore()
        {
            var path = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
            path = Path.Combine(path, Conventions.RavenDataDirectory);
            var populate = !Directory.Exists(path);

            var documentStore = new EmbeddableDocumentStore()
            {
                EnlistInDistributedTransactions = false,
                DataDirectory = path,//"~\\App_Data\\Database",
                UseEmbeddedHttpServer = false //,
                //Configuration = { Port = 8887 }
            }.Initialize();

            if (populate)
            {
                documentStore.PopulateAll();
            }

            return documentStore;
        }