When is a Transient-scope object Deactivated in Ninject?
Posted
by nwahmaet
on Stack Overflow
See other posts from Stack Overflow
or by nwahmaet
Published on 2010-03-12T18:44:03Z
Indexed on
2010/03/12
18:47 UTC
Read the original article
Hit count: 197
When an object in Ninject is bound with InTransientScope(), the object isn't placed into the cache, since it's, er, transient and not scoped to anything.
When done with the object, I can call kernel.Release(obj); this passes through to the Cache where it retrieves the cached item and calls Pipeline.Deactivate using the cached entry.
But since transient objects aren't cached, this doesn't happen. I haven't been able to figure out where (or who) performs the deactivation for transient objects. Or is the assumption that transient objects are only ever activated, and that if I want a deactivateable object, I need to use some other scope?
© Stack Overflow or respective owner