public static void ConfigureContainer(string connectionString) { var builder = AutofacBuilder.GetBuilder(connectionString); builder.RegisterControllers(typeof(MvcApplication).Assembly); DependencyResolver.SetResolver(new AutofacDependencyResolver(builder.Build())); }
public static void ConfigureContainer(string connectionString) { var builder = AutofacBuilder.GetBuilder(connectionString); //builder.RegisterType<Class1>().As<Class1>();// builder.RegisterControllers(typeof(MvcApplication).Assembly); DependencyResolver.SetResolver(new AutofacDependencyResolver(builder.Build())); /* * builder.RegisterType<EmployeeService>().As<IEmployeeService>(); * builder.RegisterType<UnitOfWork>().As<IUnitOfWork>().WithParameter("connectionString", connectionString);*/ }