Resolve collection of types by interface

Issue #380 new
Mario Allegro created an issue

Hello,

is it currently possible with Spring4D to resolve multiple types by interface without specifying a name? I was a liitle bit astonished, that the functionality seems to be not implemented. But maybe I was not looking to deep into the sources.

If not it would be nice if we could do that, by just specifying e.g.

constructor TJobManager.Create(Jobs: IEnumerable<IJob>);

It is the pattern used in the C# DI container. I know you know it 😀

Best regards!
Mario

Comments (2)

  1. Stefan Glienke repo owner

    Currently, only IJob services that are registered under a name are being resolved for collections (TArray<IJob>, IEnumerable<IJob> or IList<IJob> works). But the code you showed does not need any modifications or specify any name.

    However, this is something I want to change in a future update but it requires quite some internal refactoring and there are other features I want to implement and fix some annoyances the container currently has.

  2. Log in to comment