Hi ,
I am starting on work on a new custom module and would like to use the Castle container to take care of constructing my object dependencies for my services.
I would like to place these services in the WindsorContainer that is loaded in application start up. My question though is, how do I (if indeed I can) reference the container from my own custom module??
Or should I create my own container in the custom module?
Thanks
Paul
Interesting question
You can always can get a reference to the container via Cuyahoga.Web.Util.ContainerAccessorUtil.GetContainer().
But I don't have a real answer on how to registrate module services...
The module controller classes (for example DownloadsModule.cs) would be a good place to register module services but they are also transient...
Maybe anybody else?
Hi!
Do you mean that you want preregistered services built by yourself which are automatically connected to the (e.g.) properties of your custom model at time of construciton? And should these services also be available for everibody else building modules?
Or should these services only useable by your own custom module?
regards
Thomas
hi,
At the moment I am just concerned with making the services available to the custom module.
I would ideally like these services to be loaded at application start up when they are read via the services.config.
Is it just a simple matter of adding a new component node to the services.config and then getting a reference to the container using Cuyahoga.Web.Util.ContainerAccessorUtil.GetContainer() from my custom module?
Thanks
Paul
dagda1Is it just a simple matter of adding a new component node to the services.config and then getting a reference to the container using Cuyahoga.Web.Util.ContainerAccessorUtil.GetContainer() from my custom module?
Yes, I think it would work. It might even be possible to create your own separate .config and include that one from the web.config.