This is a dependency injection container. Autofac.ContainerBuilder gets a new container or logger that you could tell.
builder.Register<NHibernateInstance> states that when building an NHibernateInstance during the recovery phase (i.e. retrieving an instance from the container) this is how it should be built.
The last line indicates that when NHibernateInstance is OpenSession method should be called once during the lifetime of the object.
source share