ISEbd-22_Zakharov_V.V._Moto.../MotorPlant/MotorPlantView/Program.cs

49 lines
1.6 KiB
C#
Raw Normal View History

2023-03-01 14:46:25 +04:00
using Microsoft.Extensions.DependencyInjection;
using MotorPlantBusinessLogic.BusinessLogic;
using MotorPlantContracts.BusinessLogicsContracts;
using MotorPlantContracts.StoragesContracts;
using MotorPlantListImplement.Implements;
2023-03-01 12:05:09 +04:00
namespace MotorPlantView
{
2023-03-01 14:46:25 +04:00
internal static class Program
{
private static ServiceProvider? _serviceProvider;
public static ServiceProvider? ServiceProvider => _serviceProvider;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
// Application.Run(new Form1());
}
private static void ConfigureServices(ServiceCollection services)
{
services.AddLogging(option =>
{
option.SetMinimumLevel(LogLevel.Information);
option.AddNLog("nlog.config");
});
services.AddTransient<IComponentStorage, ComponentStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<IProductStorage, ProductStorage>();
services.AddTransient<IComponentLogic, ComponentLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IProductLogic, ProductLogic>();
services.AddTransient<FormMain>();
services.AddTransient<FormComponent>();
services.AddTransient<FormComponents>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormProduct>();
services.AddTransient<FormProductComponent>();
}
}
2023-03-01 12:05:09 +04:00
}