I can imagine that it can be quite straightforward in the castle, but I am new to this technology and have not been working in Googling for a long time!
I have the following:
container.Register( Component.For<MySpecialClass>().UsingFactoryMethod( () => new MySpecialClass()).LifeStyle.Singleton);
Now itβs absolutely true that this is lazily loading, i.e. the lambda expression passed to UseFactoryMethod () is not executed until I ask Castle to allow me an instance of the class.
But I would like Castle to instantiate as soon as I registered it. Is it possible?
source share