Files
Wino-Mail/Wino.Core/CoreContainerSetup.cs

46 lines
2.1 KiB
C#
Raw Normal View History

2024-04-18 01:44:37 +02:00
using Microsoft.Extensions.DependencyInjection;
using Serilog.Core;
using Wino.Authentication;
2024-04-18 01:44:37 +02:00
using Wino.Core.Domain.Interfaces;
using Wino.Core.Integration.Processors;
using Wino.Core.Services;
using Wino.Core.Synchronizers.Errors.Outlook;
2025-02-15 12:53:32 +01:00
using Wino.Core.Synchronizers.ImapSync;
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
namespace Wino.Core;
public static class CoreContainerSetup
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
public static void RegisterCoreServices(this IServiceCollection services)
2024-04-18 01:44:37 +02:00
{
2025-02-16 11:54:23 +01:00
var loggerLevelSwitcher = new LoggingLevelSwitch();
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
services.AddSingleton(loggerLevelSwitcher);
services.AddSingleton<ISynchronizerFactory, SynchronizerFactory>();
2024-04-18 01:44:37 +02:00
2025-02-16 11:54:23 +01:00
services.AddTransient<IGmailChangeProcessor, GmailChangeProcessor>();
services.AddTransient<IImapChangeProcessor, ImapChangeProcessor>();
services.AddTransient<IOutlookChangeProcessor, OutlookChangeProcessor>();
services.AddTransient<IWinoRequestProcessor, WinoRequestProcessor>();
services.AddTransient<IWinoRequestDelegator, WinoRequestDelegator>();
services.AddTransient<IImapTestService, ImapTestService>();
services.AddTransient<IAuthenticationProvider, AuthenticationProvider>();
services.AddTransient<IAutoDiscoveryService, AutoDiscoveryService>();
services.AddTransient<IFontService, FontService>();
services.AddTransient<IUnsubscriptionService, UnsubscriptionService>();
services.AddTransient<IOutlookAuthenticator, OutlookAuthenticator>();
services.AddTransient<IGmailAuthenticator, GmailAuthenticator>();
2025-02-15 12:53:32 +01:00
2025-02-16 11:54:23 +01:00
services.AddTransient<IImapSynchronizationStrategyProvider, ImapSynchronizationStrategyProvider>();
services.AddTransient<CondstoreSynchronizer>();
services.AddTransient<QResyncSynchronizer>();
services.AddTransient<UidBasedSynchronizer>();
// Register error factory handlers
services.AddTransient<ObjectCannotBeDeletedHandler>();
services.AddTransient<IOutlookSynchronizerErrorHandlerFactory, OutlookSynchronizerErrorHandlingFactory>();
services.AddTransient<IGmailSynchronizerErrorHandlerFactory, GmailSynchronizerErrorHandlingFactory>();
2024-04-18 01:44:37 +02:00
}
}