concept Create in category dependency injection

This is an excerpt from Manning's book Dependency Injection.
When the application starts, the code in
Startupcreates a new custom controller activator and looks up the connection string from the application’s configuration file. When a page request comes in, the application invokesCreateon the controller activator.The activator supplies the stored connection string to a new instance of
CommerceContext(not shown in the diagram). It injectsCommerceContextinto a new instance ofSqlProductRepository. In turn, theSqlProductRepositoryinstance together with an instance ofAspNetUserContextAdapter(not shown in the diagram) are injected into a new instance ofProductService. Similarly,ProductServiceis injected into a new instance ofHomeController, which is then returned from theCreatemethod.
Listing 6.14 Abstract Factory with parameterless
Createmethodpublic interface IProductRepositoryFactory { IProductRepository Create(); #1 } #1 A parameterless factory method returning a new instance of a Volatile DependencyAbstract Factories with parameterless
Createmethods are often used to allow consumers to control the lifetime of their Dependencies. In the following listing,HomeControllercontrols the lifetime ofIProductRepositoryby requesting it from the factory, and disposing of it when it finishes using it.