Skip to content

Commit

Permalink
(spectreconsole#1313) fix mixing of Registrations
Browse files Browse the repository at this point in the history
i.e. combining Register, RegisterInstance and RegisterLazy
  • Loading branch information
nils-a committed Nov 10, 2023
1 parent 6013f40 commit 86c5697
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ public void Register(ComponentRegistration registration)
foreach (var type in new HashSet<Type>(registration.RegistrationTypes))
{
if (!_registrations.ContainsKey(type))
{
{
// Only add each registration type once.
_registrations.Add(type, new HashSet<ComponentRegistration>());
_registrations[type].Add(registration);
_registrations.Add(type, new HashSet<ComponentRegistration>());
}

_registrations[type].Add(registration);
}
}

Expand Down

0 comments on commit 86c5697

Please sign in to comment.