Esempio n. 1
0
        public static void Register()
        {
            var builder = new ContainerBuilder();

            builder.Register(c => AutoMapperConfig.Config.CreateMapper()).As <IMapper>();
            builder.RegisterApiControllers(Assembly.GetExecutingAssembly()).PropertiesAutowired();

            AutofacRegistration.Register(builder);

            var container = builder.Build();

            var resolver = new AutofacWebApiDependencyResolver(container);

            GlobalConfiguration.Configuration.DependencyResolver = resolver;
        }
Esempio n. 2
0
 public static void AppInitialize()
 {
     AutofacRegistration.Register();
 }
Esempio n. 3
0
        protected void Application_Start()
        {
            GlobalConfiguration.Configure(WebApiConfig.Register);

            AutofacRegistration.Register();
        }