Ejemplo n.º 1
0
        private static IDocumentStore GetDocumentStore()
        {
            string appSetting = ConfigurationManager.AppSettings["RAVENHQ_CONNECTION_STRING"];

            var parser = ConnectionStringParser <RavenConnectionStringOptions> .FromConnectionString(appSetting);

            parser.Parse();

            string apiKey = parser.ConnectionStringOptions.ApiKey;
            string url    = parser.ConnectionStringOptions.Url;

            var documentStore = new DocumentStore {
                ApiKey = apiKey, Url = url
            };

            RavenDbInitializer.Initialize(documentStore);

            return(documentStore);
        }