开发者

ArrayResolver in castle windsor behaves strangely

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 : I开发者_JS百科SomeInterface
{
  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?


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>();

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜