I am using wcf 4 and trying to use some Ioc container to resolve service dependencies. I was looking at Castle Windsor and StructureMap. I haven't use any of them with wcf.
The scenario is that I have IService1 and Iservice2. Service1 is using service2:
public class Service1 : IService1
{
public Service1(IService2 service2)
{
}
}
If I use WcfFacility from Castle with a transient lifecycle for service2 will it automatically dispose service2 after service1 is done with it(consider service1 a per-call instantiation for example)? And how exactly does that work internally. How is this done with structuremap?
Some sample code would be really appreciated.