meta info in settings

This commit is contained in:
2022-01-23 15:22:28 +01:00
parent ea1bdcbba0
commit e2e1614fbd
8 changed files with 79 additions and 12 deletions
@@ -1,6 +1,7 @@
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Raven.Client.Documents;
using Raven.Client.Documents.Indexes;
using Raven.Client.Http;
namespace zero.Persistence;
@@ -24,11 +25,12 @@ internal class ZeroPersistenceModule : ZeroModule
protected ZeroDocumentStore CreateRavenStore(IServiceProvider services)
{
IZeroOptions options = services.GetService<IZeroOptions>();
RavenOptions ravenOptions = options.For<RavenOptions>();
IZeroDocumentConventionsBuilder conventionsBuilder = services.GetService<IZeroDocumentConventionsBuilder>();
IZeroDocumentStore store = new ZeroDocumentStore(options)
{
Urls = new string[1] { options.For<RavenOptions>().Url },
Urls = new string[1] { ravenOptions.Url },
Conventions =
{
AggressiveCache =
@@ -46,8 +48,8 @@ internal class ZeroPersistenceModule : ZeroModule
// create all indexes
if (options.Initialized)
{
//var indexes = options.Raven.Indexes.BuildAll(options, store);
//IndexCreation.CreateIndexes(indexes, store, database: options.Raven.Database);
var indexes = ravenOptions.Indexes.BuildAll(options, store);
IndexCreation.CreateIndexes(indexes, store, database: ravenOptions.Database);
}
return (ZeroDocumentStore)raven;