2023-05-08 13:51:25 +04:00
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using RestaurantBusinessLogic.BusinessLogics;
|
|
|
|
using RestaurantContracts.BusinessLogicsContracts;
|
|
|
|
using RestaurantContracts.StoragesContracts;
|
|
|
|
using RestaurantDatabaseImplement.Implements;
|
|
|
|
using System;
|
|
|
|
|
2023-05-02 22:51:41 +04:00
|
|
|
namespace RestaurantView
|
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2023-05-08 13:51:25 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
2023-05-02 22:51:41 +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-05-08 13:51:25 +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<IComponentStorage, ComponentStorage>();
|
|
|
|
services.AddTransient<IProductStorage, ProductStorage>();
|
|
|
|
services.AddTransient<IOrderStorage, OrderStorage>();
|
|
|
|
services.AddTransient<IProviderStorage, ProviderStorage>();
|
2023-05-16 23:49:52 +04:00
|
|
|
services.AddTransient<IBackUpInfo, BackUpInfo>();
|
2023-05-08 13:51:25 +04:00
|
|
|
|
|
|
|
services.AddTransient<IClientLogic, ClientLogic>();
|
|
|
|
services.AddTransient<IComponentLogic, ComponentLogic>();
|
|
|
|
services.AddTransient<IProductLogic, ProductLogic>();
|
|
|
|
services.AddTransient<IOrderLogic, OrderLogic>();
|
|
|
|
services.AddTransient<IProviderLogic, ProviderLogic>();
|
2023-05-16 23:49:52 +04:00
|
|
|
services.AddTransient<IBackUpLogic, BackUpLogic>();
|
2023-05-08 13:51:25 +04:00
|
|
|
|
|
|
|
services.AddTransient<FormMain>();
|
|
|
|
services.AddTransient<FormClients>();
|
|
|
|
services.AddTransient<FormClient>();
|
|
|
|
services.AddTransient<FormProvider>();
|
|
|
|
services.AddTransient<FormProviders>();
|
|
|
|
services.AddTransient<FormComponent>();
|
|
|
|
services.AddTransient<FormComponents>();
|
2023-05-16 23:26:45 +04:00
|
|
|
services.AddTransient<FormComponentProvider>();
|
|
|
|
services.AddTransient<FormProduct>();
|
|
|
|
services.AddTransient<FormProducts>();
|
|
|
|
services.AddTransient<FormProductComponent>();
|
|
|
|
services.AddTransient<FormCreateOrder>();
|
|
|
|
services.AddTransient<FormOrderProduct>();
|
2023-05-02 22:51:41 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|