2023-03-28 17:32:55 +04:00
|
|
|
using BeautySaloonBusinessLogic;
|
|
|
|
using BeautySaloonContracts.BusinessLogicsContracts;
|
|
|
|
using BeautySaloonContracts.StoragesContracts;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
2023-03-27 23:58:06 +04:00
|
|
|
namespace BeautySaloonView
|
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2023-03-28 17:32:55 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
2023-03-27 23:58:06 +04:00
|
|
|
/// <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();
|
2023-03-28 17:32:55 +04:00
|
|
|
|
|
|
|
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>();
|
2023-03-27 23:58:06 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|