I have for instance 2 interfases IInterface1
and IInterface2
,
public interface IInterface1 {...}
public interface IInterface2 {...}
and one implementation of these interfaces ImplClass
.
public class ImplClass : IInterface1, IInterface2 {...}
I have to be sure that application has only one instance of ImplClass, which will be used as IInterface1 and IInterface2. I'm using ninject for dependency injection. So my qustion is: Does code below will meet my requirements?
...
Bind<IInterface1>().To<ImplClass>().Using<SingletonBehavior>();
Bind<IInterface2>().To<ImplClass>().Using<SingletonBehavior>();
...
Or this code will create 2 instances of ImplClass, for eash interface?