Stefan Tsalapatis - 99 - May 17, 2014

Is the SS Funq IoC a singleton ? I would like to use it independently from AppHost   for our application needs. I did read  also this helpful answer of Demis,
I should compile it from src, separately, if not use SS  in the front-end .What if  I use it also in the service-layer but before AppHost  and maybe  in another long-running thread ?

Funq.Conainer is not a singleton itself, but ServiceStack uses the same instance at AppHost.Container.

Fredrick Lackey:

I wouldn’t get fixated on AppHost… especially if you only need / want bits and pieces.  The Funq.Container can be used just like any other class… stored as a private field in your class, in a Global variable.  The AppHost just makes it easier to do this in the service layer of your solution.  If you’re looking for a singleton pattern somewhere OUTSIDE of the service layer, you could always create your own singleton “engine” or other class which will CONTAIN a normal property of type Funq.Container…

Stefan Tsalapatis:

+Fredrick Lackey
 I know what means singleton . I asked if there is a problem with 2 instances of Funq.Container initialized in the  same application.