2023-11-02 02:24:20 +04:00
|
|
|
using Contracts.StoragesContracts;
|
|
|
|
using DataBaseImplement.Implements;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
2023-11-01 21:10:48 +04:00
|
|
|
namespace AppView
|
|
|
|
{
|
|
|
|
internal static class Program
|
|
|
|
{
|
2023-11-02 02:24:20 +04:00
|
|
|
private static ServiceProvider? _serviceProvider;
|
|
|
|
public static ServiceProvider? ServiceProvider => _serviceProvider;
|
2023-11-01 21:10:48 +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-11-02 02:24:20 +04:00
|
|
|
var services = new ServiceCollection();
|
|
|
|
ConfigureService(services);
|
|
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
|
|
Application.Run(_serviceProvider.GetRequiredService<FormMain>());
|
|
|
|
}
|
|
|
|
|
|
|
|
private static void ConfigureService(IServiceCollection services)
|
|
|
|
{
|
|
|
|
services.AddTransient<IProviderStorage, ProviderStorage>();
|
|
|
|
services.AddTransient<ITypeStorage, TypeStorage>();
|
|
|
|
services.AddTransient<FormMain>();
|
|
|
|
services.AddTransient<FormProvider>();
|
|
|
|
services.AddTransient<FormType>();
|
2023-11-01 21:10:48 +04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|