using LibraryBusinessLogic.BusinessLogics; using LibraryContracts.BusinessLogicsContracts; using LibraryContracts.StorageContracts; using LibraryDatabaseImplement.Implements; using Unity; using Unity.Lifetime; namespace LibraryView { public static class Program { private static IUnityContainer container = null; public static IUnityContainer Container { get { if (container == null) { container = BuildUnityContainer(); } return container; } } /// /// The main entry point for the application. /// [STAThread] static void Main() { // To customize application configuration such as set high DPI settings or default font, // see https://aka.ms/applicationconfiguration. Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(Container.Resolve()); } private static IUnityContainer BuildUnityContainer() { var currentContainer = new UnityContainer(); currentContainer.RegisterType(new HierarchicalLifetimeManager()); currentContainer.RegisterType(new HierarchicalLifetimeManager()); currentContainer.RegisterType(new HierarchicalLifetimeManager()); currentContainer.RegisterType(new HierarchicalLifetimeManager()); return currentContainer; } } }