October 31, 2015 by Anuraj Estimated read time : 1 min
ASP.NET5 comes with inbuilt dependency injection framework. This post is about using Autofac DI framework instead the in built DI framework. You can find more details about ASP.NET5 DI Framework in ASP.NET5 DependencyInjection respository. And you can find more details about Autofac in Autofac documentation
First you need to refererence the Autofac related assemblies in the project.json file
I am using the autofac getting started example interface and implementation.
And here is the implementation.
Then you need to regsiter types with autofac container in your startup file ConfigureServices() method. You also need to modify the signature of the method as well.
Now you have completed the configuration. You can use the IOutput in controller constructor like this.