PIBD_21_Basalov_A_D_Project.../project/ProjectTourAgency/Program.cs

33 lines
1.1 KiB
C#

using ProjectTourAgency.Implementations;
using ProjectTourAgency.Repositories;
using Unity;
namespace ProjectTourAgency
{
internal static class Program
{
/// <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();
Application.Run(CreateContainer().Resolve<FormTourAgency>());
}
private static IUnityContainer CreateContainer()
{
var container = new UnityContainer();
container.RegisterType<IClientRepository, ClientRepository>();
container.RegisterType<IDiscountRepository, DiscountRepository>();
container.RegisterType<IReceiptRepository, ReceiptRepository>();
container.RegisterType<ITourRepository, TourRepositiry>();
return container;
}
}
}