Restructure solution layout by module
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
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>();
|
||||
|
||||
return services;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user