I want to configure structuremap to create a service using a factory class. The factory itself has a dependency that needs filling. Currently I have the following in my Registry class:
For<IDoStuffWebService>().Singleton().Use(() =>
new DoStuffWebServiceClientFactory(new ConfigProvider()).Create()
);
Rather than having to hard-code the concrete type DoStuffWebServiceClientFactory and manually fill it's dependency, I want structuremap to get this for me (it implements IDoStuffWebServiceClientFactory). It looks like IContext might help (http://docs.structuremap.net/UsingSessionContext.htm), but I'm struggling to figure out how this fits.
Any help greatly appreciated. Roger.