-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
If a type is registered in a Unity container where the interface and class follow the same pattern as used in 'registration by convention', when the RegisterTypes extension is used to register by convention, the original mapping is over-written despite the 'overwriteExistingMappings' flag of the extension method being set to 'false'.
`
var container = new UnityContainer();
container.RegisterType<IAppTester, AppTester>(new PerThreadLifetimeManager());
container.RegisterTypes(
AllClasses.FromLoadedAssemblies(),
WithMappings.FromMatchingInterface,
WithName.Default);
container.Registrations.First(r => r.RegisteredType.Equals(typeof(IAppTester))).LifetimeManager.GetType().Should().Be<PerThreadLifetimeManager>("specifically registered type should remain");
`
Metadata
Metadata
Assignees
Labels
No labels