views:

192

answers:

2

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...)
+1  A: 

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

container.Resolve<ConsoleApp>(new Hashtable(){{"args", args}});
Igor Brejc
yeah, this is one cool features of .NET 3.5 :)
Krzysztof Koźmic
+3  A: 

You can also pass an anonymous object as parameter:

container.Resolve<ConsoleApp>(new { args, banana = X });
Mauricio Scheffer