Exemple #1
0
        public static void ConfigureContainer(string connectionString)
        {
            var builder = AutofacBuilder.GetBuilder(connectionString);

            builder.RegisterControllers(typeof(MvcApplication).Assembly);
            DependencyResolver.SetResolver(new AutofacDependencyResolver(builder.Build()));
        }
Exemple #2
0
        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);*/
        }