concept root container in category dependency injection

appears as: root container
Dependency Injection

This is an excerpt from Manning's book Dependency Injection.

With Autofac, however, you never resolve from the root container itself, but from a lifetime scope. Section 13.2.1 goes into more detail about lifetime scope and why resolving from the root container is a bad thing.

using (var scope = container.BeginLifetimeScope())    #1  
{
    IMeal meal = scope.Resolve<IMeal>();    #2  

    meal.Consume();    #3  

}    #4  

#1   Creates a scope from the root container
#2   Resolves a meal from the newly created scope
#3   Consumes the meal
#4   Releases the meal by ending the using block