Transient lifetime is a default lifetime of the Unity container. As the name implies it lasts very short period of time, actually, no time at all. In the Unity container terms, having transient lifetime is the same as having no lifetime manager at all.
For this lifetime manager Unity creates and returns a new instance of the requested type for each call to the Resolve method.
The Lifetime Manager
The transient lifetime is controlled by TransientLifetimeManager. This lifetime manager is used by default for all types registered using the RegisterType method where no specific manager has been provided.
RegisterType<Foo>(); RegisterType<IService, Service>();
In this example a Type
Foo and a mapping from
Service both registered with transient lifetime. So every call to
Resolve<IService>() will create a new object instance.