Most registrations performed on an ITargetContainer will result in transient objects being created when the Resolve method of an Container is called. Ultimately, the transience of an object is determined by the ITarget that is registered against the type that's requested from the container.
Some of these targets create inherently transient objects, whilst some inherit or expressly control the lifetimee of other targets.
The following table summarises this for the most common target types:
|ChangeTypeTarget||Inherited||Target doesn't create anything, only changes the type of another target's result, therefore it inherits that target's lifetime.|
|*DecoratorTarget||Yes||It's not currently possible to directly control the lifetime of a decorator - only the object it decorates.|
|DefaultTarget||No||Default values are cached per-type, therefore even value type defaults are technically singletons.|
|DelegateTarget||Depends on the delegate||The delegate is always executed, so the transience of the object it returns depends on the delegate's logic.|
|ExpressionTarget||Depends on the expression||Like DelegateTarget, the expression itself determines the lifetime of the object produced.|
|GenericConstructorTarget||Yes||Same as ConstructorTarget.|
|*OptionalParameterTarget||No||Only used to bind optional constructor parameters to their default values|
|ResolvedTarget||Depends||This target represents an explicit instruction to resolve an object/value from the container - therefore the lifetime of the object produced depends on the lifetime of the registration which ultimately gets resolved.|
|ScopedTarget||No||This target is responsible for Rezolver's implementation of scoped objects.|
|SingletonTarget||No||This target is responsible for Rezolver's implementation of singleton objects.|
|*UnscopedTarget||Inherited||This target is used to strip explicit or implicit scoping behaviour from another target.|
* Denotes a target which is used indirectly by other registrations and not generally used directly by applications
There's no need for any further examples for transient objects, as most of the examples throughout this documentation (see the constructor injection documentation for example) use the targets which are marked as transient in the above table.