(#1313) fix mixing of Registrations

i.e. combining Register, RegisterInstance and RegisterLazy
This commit is contained in:
Nils Andresen 2023-11-10 23:02:46 +01:00 committed by Patrik Svensson
parent ead7115cbe
commit 3da367f29f

View File

@ -35,11 +35,12 @@ internal sealed class ComponentRegistry : IDisposable
foreach (var type in new HashSet<Type>(registration.RegistrationTypes)) foreach (var type in new HashSet<Type>(registration.RegistrationTypes))
{ {
if (!_registrations.ContainsKey(type)) if (!_registrations.ContainsKey(type))
{ {
// Only add each registration type once. // Only add each registration type once.
_registrations.Add(type, new HashSet<ComponentRegistration>()); _registrations.Add(type, new HashSet<ComponentRegistration>());
_registrations[type].Add(registration);
} }
_registrations[type].Add(registration);
} }
} }