public static void AddRavenDbStorage(this IJobbrBuilder builder, Action <JobbrRavenDbConfiguration> config)
        {
            var ravenConfiguration = new JobbrRavenDbConfiguration();

            config(ravenConfiguration);

            builder.Add <JobbrRavenDbConfiguration>(ravenConfiguration);

            builder.Register <IJobStorageProvider>(typeof(RavenDbStorageProvider));
            builder.Register <IConfigurationValidator>(typeof(RavenDbConfigurationValidator));
        }
Esempio n. 2
0
        public RavenDbStorageProvider(JobbrRavenDbConfiguration configuration)
        {
            this._documentStore = new DocumentStore
            {
                Url             = configuration.Url,
                DefaultDatabase = configuration.Database
            };

            this._documentStore.Initialize(true);

            IndexCreation.CreateIndexes(typeof(RavenDbStorageProvider).Assembly, this._documentStore);
        }