- changed status to resolved
Unnamed registration not returned by ResolveAll when using AsDefault on named registration
Issue #22
resolved
AsDefault does not mark an existing unnamed default registration as non default.
To reproduce:
container.RegisterType<IFoo, TFoo3>;
container.RegisterType<IFoo, TFoo2>;
container.RegisterType<IFoo, TFoo1>('foo').AsDefault;
container.Build;
for foo in container.ResolveAll<IFoo> do
Writeln((foo as TObject).ClassName);
Expected:
TFoo3
TFoo2
TFoo1
Actual:
TFoo3
TFoo1
Comments (5)
-
reporter -
reporter - changed milestone to 1.1
-
reporter - changed version to 1.0 (released)
-
reporter - changed version to 1.0 (master)
-
reporter - changed version to 1.0
- Log in to comment
This issue has been handled by the recent change to TComponentRegistry.FindAll(serviceType: PTypeInfo) which is used by ResolveAll. It now only returns named registrations.