2024-05-25 23:32:30 +04:00
|
|
|
using DiningRoomView;
|
|
|
|
using DiningRoomContracts.BusinessLogicContracts;
|
|
|
|
using DiningRoomContracts.StorageContracts;
|
|
|
|
using DiningRoomDatabaseImplement.Implements;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
using Microsoft.Extensions.Logging;
|
|
|
|
using DiningRoomBusinessLogic.BusinessLogic;
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-04-29 16:27:29 +04:00
|
|
|
namespace DiningRoomView
|
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2024-05-25 23:32:30 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
2024-04-29 16:27:29 +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();
|
2024-05-25 23:32:30 +04:00
|
|
|
var services = new ServiceCollection();
|
|
|
|
ConfigureServices(services);
|
|
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
|
|
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void ConfigureServices(ServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddLogging(option =>
|
|
|
|
{
|
|
|
|
option.SetMinimumLevel(LogLevel.Information);
|
|
|
|
});
|
|
|
|
services.AddTransient<IComponentStorage, ComponentStorage>();
|
|
|
|
services.AddTransient<IProductStorage, ProductStorage>();
|
|
|
|
services.AddTransient<IDrinkStorage, DrinkStorage>();
|
|
|
|
services.AddTransient<ICardStorage, CardStorage>();
|
|
|
|
services.AddTransient<IOrderStorage, OrderStorage>();
|
|
|
|
|
|
|
|
services.AddTransient<IComponentLogic, ComponentLogic>();
|
|
|
|
services.AddTransient<IProductLogic, ProductLogic>();
|
|
|
|
services.AddTransient<IDrinkLogic, DrinkLogic>();
|
|
|
|
services.AddTransient<ICardLogic, CardLogic>();
|
|
|
|
services.AddTransient<IOrderLogic, OrderLogic>();
|
|
|
|
|
|
|
|
services.AddTransient<FormMain>();
|
|
|
|
services.AddTransient<FormComponent>();
|
|
|
|
services.AddTransient<FormComponents>();
|
|
|
|
services.AddTransient<FormProduct>();
|
|
|
|
services.AddTransient<FormProductComponent>();
|
2024-05-25 23:59:29 +04:00
|
|
|
services.AddTransient<FormDrink>();
|
|
|
|
services.AddTransient<FormDrinkComponent>();
|
|
|
|
|
2024-05-25 23:32:30 +04:00
|
|
|
|
|
|
|
|
2024-04-29 16:27:29 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|