using Unity.Lifetime;
using Unity;
using ProjectItCompany.Repositories;
using ProjectItCompany.Repositories.Implementations;

namespace ProjectItCompany
{
    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<FormItCompany>());
        }

        private static IUnityContainer CreateContainer()
        {
            var container = new UnityContainer();
            container.RegisterType<ICustomerRepository, CustomerRepository>(new TransientLifetimeManager());
            container.RegisterType<IExecutorRepository, ExecutorRepository>(new TransientLifetimeManager());
            container.RegisterType<IProjectRepository, ProjectRepository>(new TransientLifetimeManager());
            container.RegisterType<IWageRepository, WageRepository>(new TransientLifetimeManager());
            container.RegisterType<IContractRepository, ContractRepository>(new TransientLifetimeManager());
            return container;
        }

    }
}