Search code examples
inversion-of-controlcastle-windsor

Windsor Castle: A shorthand fluent interface for Resolve() parameters?


Is there some kind of a shorthand fluent interface for creating a parameters dictionary to be provided to the IWindsorContainer.Resolve() method? Something like:

container.Resolve<ConsoleApp>(Parameters.Add("args", args).Add("banana", X).Add...)

Solution

  • To answer my own question: it looks like I forgot about collection initializers:

    container.Resolve<ConsoleApp>(new Hashtable(){{"args", args}});