Robertscorp / Slender.Dependencies

A .NET library to register your project's dependencies without being tied to a specific dependency injection container.
MIT License
0 stars 0 forks source link

Consider removing GetDependency from IDependencyCollection #37

Open Robertscorp opened 9 months ago

Robertscorp commented 9 months ago

To make building collections faster, consider decorating the IDependencyCollection with a DependencyCollection that caches the dependencies, to make bulk adding dependencies faster.

This could be an extension method - "Batch", which will return a BatchDependencyCollection<TDependencyCollection. The BatchDependencyCollection can have an EndBatch method, which will return the decorated dependency collection.

Robertscorp commented 9 months ago

GetDependency won't be implemented in ServiceCollectionDependencyCollection, which will cause issues for any dependency collections that try to use GetDependency when implementing AddToDependencyCollection if the dependency collection parameter is a ServiceCollectionDependencyCollection