ProjectLib/ProjectLibrary/Program.cs

39 lines
1.4 KiB
C#
Raw Normal View History

2024-11-12 23:13:20 +04:00
using ProjectLibrary.Repositories.Implementations;
using ProjectLibrary.Repositories;
using Unity;
2024-11-08 14:21:36 +04:00
namespace ProjectLibrary
{
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();
2024-11-12 23:13:20 +04:00
Application.Run(CreateContainer().Resolve<FormLibrary>());
2024-11-08 14:21:36 +04:00
}
2024-11-12 23:13:20 +04:00
private static IUnityContainer CreateContainer()
{
var container = new UnityContainer();
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
container.RegisterType<IBookRepository, BookRepository>();
container.RegisterType<ILibraryRepository, LibraryRepository>();
container.RegisterType<IReaderRepository, ReaderRepository>();
container.RegisterType<IOrderRepository, OrderRepository>();
container.RegisterType<ITicketExtensionsRepository, TicketExtensionsRepository>();
container.RegisterType<IBookOrdersRepository, BookOrdersRepository>();
container.RegisterType<IBookLibraryRepository, BookLibraryRepository>();
return container;
}
2024-11-08 14:21:36 +04:00
}
}