Esempio n. 1
0
        public IEnumerable <ConfigurationSetupResult> Setup(string applicationEnvironment)
        {
            yield return(new ConfigurationSetupResult("superglue.RavenDb.Configure", environment =>
            {
                var documentStore = RavenDocumentStore.Create(environment);

                environment[RavenEnvironmentConstants.DocumentStore] = documentStore;

                environment.AlterSettings <IocConfiguration>(x => x.Register(typeof(IDocumentStore), documentStore)
                                                             .Register(typeof(IRavenSearch), typeof(DefaultRavenSearch))
                                                             .Register(typeof(IRavenSessions), typeof(DefaultRavenSessions))
                                                             .ScanOpenType(typeof(IRavenSearchPart <>))
                                                             .ScanOpenType(typeof(IRavenSpecialCommandSearch <>))
                                                             .ScanOpenType(typeof(IHandleLeftoverSearchPart <>))
                                                             .ScanOpenType(typeof(IRavenFreeTextSearch <>)));

                return Task.CompletedTask;
            }, "superglue.ContainerSetup"));
        }
Esempio n. 2
0
        public Task CreateIndexes(Assembly assembly, string database)
        {
            var documentStore = RavenDocumentStore.Create(Environment, database);

            return(IndexCreation.CreateIndexesAsync(assembly, documentStore));
        }