Browse Source

Fix dependency injection.

pull/719/head
Sebastian 5 years ago
parent
commit
01082f4f98
  1. 18
      backend/src/Squidex/Config/Domain/StoreServices.cs

18
backend/src/Squidex/Config/Domain/StoreServices.cs

@ -59,21 +59,24 @@ namespace Squidex.Config.Domain
services.AddSingletonAs(c => GetDatabase(c, mongoDatabaseName))
.As<IMongoDatabase>();
services.AddTransientAs(c => new DeleteContentCollections(GetDatabase(c, mongoContentDatabaseName)))
.As<IMigration>();
services.AddTransientAs(c => new RestructureContentCollection(GetDatabase(c, mongoContentDatabaseName)))
.As<IMigration>();
services.AddSingletonAs<MongoMigrationStatus>()
.As<IMigrationStatus>();
services.AddTransientAs<ConvertOldSnapshotStores>()
.As<IMigration>();
services.AddTransientAs(c => new DeleteContentCollections(GetDatabase(c, mongoContentDatabaseName)))
.As<IMigration>();
services.AddTransientAs(c => new RestructureContentCollection(GetDatabase(c, mongoContentDatabaseName)))
.As<IMigration>();
services.AddTransientAs(c => new ConvertDocumentIds(GetDatabase(c, mongoDatabaseName), GetDatabase(c, mongoContentDatabaseName)))
.As<IMigration>();
services.AddSingletonAs(c => ActivatorUtilities.CreateInstance<MongoContentRepository>(c, GetDatabase(c, mongoContentDatabaseName)))
.As<IContentRepository>().As<ISnapshotStore<ContentDomainObject.State>>();
services.AddTransientAs<ConvertRuleEventsJson>()
.As<IMigration>();
@ -113,9 +116,6 @@ namespace Squidex.Config.Domain
services.AddSingletonAs<MongoAssetFolderRepository>()
.As<IAssetFolderRepository>().As<ISnapshotStore<AssetFolderDomainObject.State>>();
services.AddSingletonAs(c => ActivatorUtilities.CreateInstance<MongoContentRepository>(c, GetDatabase(c, mongoContentDatabaseName), false))
.As<IContentRepository>().As<ISnapshotStore<ContentDomainObject.State>>();
services.AddSingletonAs<MongoSchemasHash>()
.AsOptional<ISchemasHash>().As<IEventConsumer>();

Loading…
Cancel
Save