UnityDependencyContainer fix

This commit is contained in:
russell 2024-05-18 17:38:10 +04:00
parent 8bcff340bd
commit 9ca13f5fea

View File

@ -19,7 +19,7 @@ namespace CarRepairShopContracts.DI
_container.AddExtension(new LoggingExtension(factory)); _container.AddExtension(new LoggingExtension(factory));
} }
void IDependencyContainer.RegisterType<T, U>(bool isSingle) public void RegisterType<T, U>(bool isSingle) where U : class, T where T : class
{ {
_container.RegisterType<T, U>(isSingle ? TypeLifetime.Singleton : TypeLifetime.Transient); _container.RegisterType<T, U>(isSingle ? TypeLifetime.Singleton : TypeLifetime.Transient);
} }