dadhi / DryIoc

DryIoc is fast, small, full-featured IoC Container for .NET
MIT License
1.03k stars 122 forks source link

Populate on `IRegistrator` #660

Closed Falco20019 closed 1 month ago

Falco20019 commented 1 month ago

Is there a reason why RegisterDescriptor and Populate in the DryIocAdapter are defined on IContainer instead of IRegistrator? It's only using those APIs.

I'm in a context where I only get IRegistrator internally and would like to add a ServiceCollection using Populate. ((IContainer)builder).Populate(sc); works fine, it's just ugly to rely on the knowledge that an IRegistrator in my case is always castable.

Would it be possible to change the API in an upcoming major version (if there is no hard reason for it as it is) or to at least add the IRegistrator variants, marking the other ones deprecated for backwards-compatibility?

dadhi commented 1 month ago

@Falco20019 Hi, seems you are right. I will try the change.

dadhi commented 1 month ago

@Falco20019 Done.

Falco20019 commented 1 month ago

Thanks! Is there a (rough) roadmap when this might end up in a release?

dadhi commented 1 month ago

Soon. I want to release it in the upcoming month.