Удалил ServiceProvider из Program.cs

This commit is contained in:
Никита Потапов 2024-05-19 21:52:57 +04:00
parent 2bacaad2c3
commit 56b7de7d18

View File

@ -19,8 +19,6 @@ namespace SecuritySystemView
{
internal static class Program
{
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
/// <summary>
/// The main entry point for the application.
/// </summary>
@ -101,6 +99,6 @@ namespace SecuritySystemView
DependencyManager.Instance.RegisterType<FormImplementers>();
DependencyManager.Instance.RegisterType<FormMails>();
}
private static void MailCheck(object obj) => ServiceProvider?.GetService<AbstractMailWorker>()?.MailCheck();
private static void MailCheck(object obj) => DependencyManager.Instance.Resolve<AbstractMailWorker>()?.MailCheck();
}
}