■ Introducing Autofac
■ Managing lifetime
■ Working with multiple components
■ Configuring difficult APIs

The second-generation DI CONTAINERS are based directly on .NET 3.5, so their architectures are often directly based on the language and platform features that became available at that time. Not only do they have an intimate understanding of generics, but many also employ lambda expressions as central API elements. Although the majority of the mature DI CONTAINERS also support these more modern language constructs, their core engines are typically based on earlier .NET versions. Because the second-generation containers have no such baggage, they’re typically designed around these features from the ground up.Autofac is a fairly comprehensive DI CONTAINER that offers a carefully designed and consistent API. It has been around since late 2007 and seems to have a fair-sized
user base.we’ll examine how Autofac can be used to apply the principles and patterns laid. This chapter should enable you to get started, as well as deal with the most common issues that may come up as you use Autofac on a daily basis. It’s not a complete treatment of Autofac—that would take several more Posts but if you want to know more about Autofac, the best place to start is at the Autofac home page at to You can read the chapter in isolation from the rest of part 4 specifically to learn about Autofac, or you can read it together with the other compare DI CONTAINERS. The focus of this blog show how Autofac relates to and implements the patterns and principles described.