Files
git.stella-ops.org/src/Notify/__Libraries/StellaOps.Notify.Storage.Mongo/ServiceCollectionExtensions.cs
StellaOps Bot ef6e4b2067
Some checks failed
AOC Guard CI / aoc-guard (push) Has been cancelled
AOC Guard CI / aoc-verify (push) Has been cancelled
Docs CI / lint-and-preview (push) Has been cancelled
Policy Lint & Smoke / policy-lint (push) Has been cancelled
api-governance / spectral-lint (push) Has been cancelled
oas-ci / oas-validate (push) Has been cancelled
Policy Simulation / policy-simulate (push) Has been cancelled
sdk-generator-smoke / sdk-smoke (push) Has been cancelled
SDK Publish & Sign / sdk-publish (push) Has been cancelled
Merge branch 'main' of https://git.stella-ops.org/stella-ops.org/git.stella-ops.org
2025-11-27 21:45:32 +02:00

44 lines
2.6 KiB
C#

using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using StellaOps.Notify.Storage.Mongo.Internal;
using StellaOps.Notify.Storage.Mongo.Migrations;
using StellaOps.Notify.Storage.Mongo.Options;
using StellaOps.Notify.Storage.Mongo.Repositories;
namespace StellaOps.Notify.Storage.Mongo;
public static class ServiceCollectionExtensions
{
public static IServiceCollection AddNotifyMongoStorage(this IServiceCollection services, IConfiguration configuration)
{
ArgumentNullException.ThrowIfNull(services);
ArgumentNullException.ThrowIfNull(configuration);
services.Configure<NotifyMongoOptions>(configuration);
services.AddSingleton<NotifyMongoContext>();
services.AddSingleton<NotifyMongoMigrationRunner>();
services.AddSingleton<INotifyMongoMigration, EnsureNotifyCollectionsMigration>();
services.AddSingleton<INotifyMongoMigration, EnsureNotifyIndexesMigration>();
services.AddSingleton<INotifyMongoInitializer, NotifyMongoInitializer>();
services.AddSingleton<INotifyRuleRepository, NotifyRuleRepository>();
services.AddSingleton<INotifyChannelRepository, NotifyChannelRepository>();
services.AddSingleton<INotifyTemplateRepository, NotifyTemplateRepository>();
services.AddSingleton<INotifyDeliveryRepository, NotifyDeliveryRepository>();
services.AddSingleton<INotifyDigestRepository, NotifyDigestRepository>();
services.AddSingleton<INotifyLockRepository, NotifyLockRepository>();
services.AddSingleton<INotifyAuditRepository, NotifyAuditRepository>();
services.AddSingleton<INotifyQuietHoursRepository, NotifyQuietHoursRepository>();
services.AddSingleton<INotifyMaintenanceWindowRepository, NotifyMaintenanceWindowRepository>();
services.AddSingleton<INotifyThrottleConfigRepository, NotifyThrottleConfigRepository>();
services.AddSingleton<INotifyOperatorOverrideRepository, NotifyOperatorOverrideRepository>();
services.AddSingleton<INotifyEscalationPolicyRepository, NotifyEscalationPolicyRepository>();
services.AddSingleton<INotifyEscalationStateRepository, NotifyEscalationStateRepository>();
services.AddSingleton<INotifyOnCallScheduleRepository, NotifyOnCallScheduleRepository>();
services.AddSingleton<INotifyInboxRepository, NotifyInboxRepository>();
services.AddSingleton<INotifyLocalizationRepository, NotifyLocalizationRepository>();
services.AddSingleton<INotifyIncidentRepository, NotifyIncidentRepository>();
return services;
}
}