Hey everybody, I wanted to throw this out in case someone with more experience and understanding with Windsor can provide a quick answer. I had an idea last week: Add factory method registration to the CSL. It's something that all of the supported IoC containers provide, and I think it's something that could keep developers from having to pick a specific IoC container during development. I was able to get it to work with Unity, StructureMap, Ninject, and Autofac. Castle Windsor is a different matter. I've tried a number of things, but I always seem to get a fail when I resolve.
I've included a link to the registration line in the CSL below. I've also included my Register method in case that helps. Any ideas?
public void Register<Interface>(Func<Interface> factoryMethod) where Interface : class
{
var registration = Component.For<Interface>()
.UsingFactoryMethod(factoryMethod.Invoke);
registrationList.Add(registration);
}
Darren Cauthon
dar...@cauthon.com(913) 712-9648