using AutoWorkshopBusinessLogic.BusinessLogics; using AutoWorkshopContracts.BusinessLogicContracts; using AutoWorkshopContracts.StoragesContracts; using AutoWorkshopDatabaseImplement.Implements; using AutoWorkshopView.Forms; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; using NLog.Extensions.Logging; namespace AutoWorkshopView { internal static class Program { private static ServiceProvider? _serviceProvider; public static ServiceProvider? ServiceProvider => _serviceProvider; [STAThread] static void Main() { ApplicationConfiguration.Initialize(); var Services = new ServiceCollection(); ConfigureServices(Services); _serviceProvider = Services.BuildServiceProvider(); Application.Run(_serviceProvider.GetRequiredService()); } private static void ConfigureServices(ServiceCollection Services) { Services.AddLogging(option => { option.SetMinimumLevel(LogLevel.Information); option.AddNLog("nlog.config"); }); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); Services.AddTransient(); } } }