Sorry for this noob question. I'm beginning to use the Unity 2.0 container with Silverlight and am putting some singletons in it. For the singletons to work, do I need to have just one instance of the container in my application? I assume that making a new unity container instance whenever I want to look up my singletons will result in separate containers with separate singletons.
Thanks, -Jon
You need a single instance of a container to achieve singleton behaviour. Also you need to register your singleton classes with ContainerControlledLifetimeManager.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With