volosoft / castle-windsor-ms-adapter

Castle Windsor ASP.NET Core / Microsoft.Extensions.DependencyInjection Adapter
https://www.nuget.org/packages/Castle.Windsor.MsDependencyInjection
MIT License
85 stars 29 forks source link

Fixed order of items returned for IEnumerable<T> in nested dependencies #21

Closed Katulus closed 6 years ago

Katulus commented 6 years ago

If you have a class that has constructor dependency IEnumerable<T> and there are multiple services of type T registered in container then the order of items injected to constructor is opposite to registration order. That causes issues in some ASP.NET Core classes.

You have correct Reverse in ScopedWindsorServiceProvider.ResolveInstanceOrNull() when someone asks for IEnumerable<T> directly but that does not cover nested dependencies.

See unit tests *_ResolvingClassDependingOnCollection_*.

Katulus commented 6 years ago

Ping @hikalkan.

hikalkan commented 6 years ago

Thank you for fixing this. I will check and merge.

Katulus commented 6 years ago

Do you have any time frame for releasing this? I need the changes in order to make my code work so whether I should rather use custom fork for now or whether you plan to release it in few days and I can use official Nuget.

hikalkan commented 6 years ago

Thank you for your contribution. I will release it now.

hikalkan commented 6 years ago

Released: https://www.nuget.org/packages/Castle.Windsor.MsDependencyInjection/3.2.0