SUBD_PIbd-21_Balberova_D.N./BeautySaloon/BeautySaloonView/Program.cs
2023-03-29 20:00:53 +04:00

58 lines
2.4 KiB
C#

using BeautySaloonBusinessLogic;
using BeautySaloonContracts.BusinessLogicsContracts;
using BeautySaloonContracts.StoragesContracts;
using BeautySaloonDatabaseImplement.Implements;
using Microsoft.Extensions.DependencyInjection;
namespace BeautySaloonView
{
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();
var services = new ServiceCollection();
ConfigureServices(services);
_serviceProvider = services.BuildServiceProvider();
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
}
private static void ConfigureServices(ServiceCollection services)
{
services.AddTransient<IClientStorage, ClientStorage>();
services.AddTransient<IEmployeeStorage, EmployeeStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<IPositionStorage, PositionStorage>();
services.AddTransient<IServiceStorage, ServiceStorage>();
services.AddTransient<IClientLogic, ClientLogic>();
services.AddTransient<IEmployeeLogic, EmployeeLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IPositionLogic, PositionLogic>();
services.AddTransient<IServiceLogic, ServiceLogic>();
services.AddTransient<FormClient>();
services.AddTransient<FormClientOrders>();
services.AddTransient<FormClients>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormEmployee>();
services.AddTransient<FormEmployees>();
services.AddTransient<FormMain>();
services.AddTransient<FormOrderServices>();
services.AddTransient<FormPosition>();
services.AddTransient<FormPositions>();
services.AddTransient<FormService>();
services.AddTransient<FormServices>();
}
}
}