views:

13

answers:

1

Hi,

Im using windsor along with the subresolver ArrayResolver and works great besides one thing.

Here the ArrayResolver works the the way it supposed to work.

class SomeClass : ISomeInterface
{
  public SomeClass(ISomeDependency[] dependecies)
  {}
}

This thing does not work

ISomeDependency[] = container.Resolve<ISomeDependency[]>().Cast<ISomeDependency>().ToArray()

, and this is why im asking, why isn't the sub resolver involved here?

A: 

because it's a sub Dependency resolver - it will resolve dependencies of the component you pull, not the component itself.

For that use

container.ResolveAll<ISomeDependency>();

Krzysztof Koźmic
Ok, thats the way I solved my problem, thanks for the explanation Krzysztof.
Marcus

related questions