Лабораторная работа №1

This commit is contained in:
Anitonchik 2024-11-15 12:35:39 +04:00
parent b409d201d5
commit 02c015aa69

View File

@ -1,6 +1,7 @@
using ProjectCompanyFurniture.Repositories;
using ProjectCompanyFurniture.Repositories.Implementations;
using Unity;
using Unity.Lifetime;
namespace ProjectCompanyFurniture
{
@ -21,11 +22,11 @@ namespace ProjectCompanyFurniture
private static IUnityContainer CreateContainer()
{
var container = new UnityContainer();
container.RegisterType<IClientRepository, ClientRepository>();
container.RegisterType<IInvoiceRepository, InvoiceRepository>();
container.RegisterType<IManufacturerRepository, ManufacturerRepository>();
container.RegisterType<IProductMovementRepository, ProductMovementRepository>();
container.RegisterType<IProductRepository, ProductRepository>();
container.RegisterType<IClientRepository, ClientRepository>(new TransientLifetimeManager());
container.RegisterType<IInvoiceRepository, InvoiceRepository>(new TransientLifetimeManager());
container.RegisterType<IManufacturerRepository, ManufacturerRepository>(new TransientLifetimeManager());
container.RegisterType<IProductMovementRepository, ProductMovementRepository>(new TransientLifetimeManager());
container.RegisterType<IProductRepository, ProductRepository>(new TransientLifetimeManager());
return container;
}
}