What Autofac version should I use for ASP.NET MVC 1.0. Also, What examples are available for using it with ASP.NET MVC using the repository pattern?
public class MyController : BaseController
{
private readonly IUser _user;
private readonly ICompany _company;
public MyController(IUser user, ICompany company)
{
_user = user;
_company = company;
}
public ActionResult Index()
{
// Actions
}
}
I’ve decided to use
StructureMapfor my application. Here’s what I’ve did to make it work:Create my own CustomFactory class:
Create a Bootstrapper, using the StructureMap convention to register all the interfaces and its implementation for my assembly. (I’ve posted a blog post on this):
Register StructureMap in Global.asax.cs: