SUBD_Aleikin/Restaurant/RestaurantView/Program.cs

61 lines
2.6 KiB
C#
Raw Normal View History

using Microsoft.Extensions.DependencyInjection;
using RestaurantBusinessLogic.BusinessLogics;
using RestaurantContracts.BusinessLogicsContracts;
using RestaurantContracts.StoragesContracts;
using RestaurantDatabaseImplement.Implements;
using System;
namespace RestaurantView
{
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<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>();
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>();
services.AddTransient<FormMain>();
services.AddTransient<FormClients>();
services.AddTransient<FormClient>();
services.AddTransient<FormProvider>();
services.AddTransient<FormProviders>();
services.AddTransient<FormComponent>();
services.AddTransient<FormComponents>();
services.AddTransient<FormComponentProvider>();
services.AddTransient<FormProduct>();
services.AddTransient<FormProducts>();
services.AddTransient<FormProductComponent>();
services.AddTransient<FormCreateOrder>();
services.AddTransient<FormOrderProduct>();
2023-05-17 00:48:03 +04:00
services.AddTransient<FormTests>();
}
}
}