Configuration of object’s life-time in Ninject is set by invocation of appropriate method as it’s shown below:
List of predefined methods:
InScope- delegate Func, which defines life time of an object, is passed to this method. Until the object returned by delegate is not disposed and the same one, the same instance of the object will be used. It is most common method and the other methods use it.
InTransientScope- new instance is created for each request. It is the same as
InScope(c => null).
InThreadScope- new instance is created per each thread. It is the same as
InScope(c => System.Threading.Thread.CurrentThread)
InSingletonScope- the name speaks for itself. It is the same as
InRequestScope- new instance is created for each HttpContext. The same as
InScope(c => System.Web.HttpContext.Current)