Exemple #1
0
        public void Configuration(IAppBuilder app)
        {
            var builder = AutofacHelper.InitBuilder();

            builder.RegisterModule <ControllerModule>();
            builder.RegisterModule <HelpersModule>();
            var container = builder.Build();

            DependencyResolver.SetResolver(new AutofacDependencyResolver(container));
            app.UseAutofacMiddleware(container);
            app.UseAutofacMvc();
            app.UseCookieAuthentication(new CookieAuthenticationOptions
            {
                AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
                LoginPath          = new PathString("/Account/Login"),
            });
        }