The title has it all. When I do this:
var kernel = new StandardKernel();
kernel.Bind<IMyClass>().To<MyClass>().InSingletonScope();
var myClass = kernel.Get<IMyClass>();
Where is the instance of MyClass stored? Is it stored in a static dictionary somewhere globally? Or is it stored in the kernel instance?
For example if I do this:
var kernel1 = new StandardKernel();
var kernel2 = new StandardKernel();
kernel1.Bind<IMyClass>().To<MyClass>().InSingletonScope();
kernel2.Bind<IMyClass>().To<MyClass>().InSingletonScope();
var myClass1 = kernel1.Get<IMyClass>();
var myClass2 = kernel2.Get<IMyClass>();
Will myClass1 be the same instance as myClass2 or will they be different instances.
To kind of jump on an inevitable question "Why do you need to do that?": It doesn't matter. That is not the point of the question. I have my reasons and just want to know how this piece works.