SUBD_PIbd-21_Balberova_D.N./BeautySaloon/BeautySaloonView/Program.cs
2023-03-28 17:32:55 +04:00

46 lines
1.8 KiB
C#

using BeautySaloonBusinessLogic;
using BeautySaloonContracts.BusinessLogicsContracts;
using BeautySaloonContracts.StoragesContracts;
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, IngredientStorage>();
services.AddTransient<IOrderStorage, OrderStorage>();
services.AddTransient<IPositionStorage, SushiStorage>();
services.AddTransient<IServiceStorage, SushiStorage>();*/
services.AddTransient<IClientLogic, ClientLogic>();
services.AddTransient<IEmployeeLogic, EmployeeLogic>();
services.AddTransient<IOrderLogic, OrderLogic>();
services.AddTransient<IPositionLogic, PositionLogic>();
services.AddTransient<IServiceLogic, ServiceLogic>();
services.AddTransient<FormMain>();
}
}
}