-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Labels
New Feature 🚀New feature requestNew feature requestRequires Investigation 👮Requires further verificationRequires further verification
Milestone
Description
Description
Currently RegisterType, RegisterInstance, etc. will accept any lifetime manager with no regard if it is compatible with corresponding registration type.
Problem
It is possible to register instance
with TransientLifetimeManager
, for example.
Solution
Add following interfaces to specify compatible registration type for the lifetime managers:
public interface IFactoryLifetimeManager { }
public interface IInstanceLifetimeManager { }
public interface ITypeLifetimeManager { }
Change IUnityContainer interface to support these interfaces:
public interface IUnityContainer : IDisposable
{
... RegisterType(..., ITypeLifetimeManager lifetime, . . .);
... RegisterInstance(..., IInstanceLifetimeManager lifetime);
... RegisterFactory(..., IFactoryLifetimeManager lifetime);
. . .
}
Metadata
Metadata
Assignees
Labels
New Feature 🚀New feature requestNew feature requestRequires Investigation 👮Requires further verificationRequires further verification