I'm adapting some code originally written for Windsor to use StructureMap. In the Windsor example we release the handler. Is it necessary to do this with StructureMap instances that are cached "per request"? The code is:
foreach (var handler in ObjectFactory.GetAllInstances<IHandle<TEvent>>()) {
handler.Handle(@event);
// do I need to dispose here?
}
// or should I do this:
ObjectFactory.EjectAllInstancesOf<IHandle<TEvent>>();
Thanks Ben