Esempio n. 1
0
        private static void InitializeContainer(Container container)
        {
            BootStrapperApplication.RegisterServices(container);
            BootStrapperDomain.RegisterServices(container);
            BootStrapperInfra.RegisterServices(container);

            container.Register <IUserStore <ApplicationUser> >();
        }
Esempio n. 2
0
        private static void InitializeContainer(Container container)
        {
            BootStrapperApplication.RegisterServices(container);
            BootStrapperDomain.RegisterServices(container);
            BootStrapperInfra.RegisterServices(container);

            container.Register <IUserStore <ApplicationUser> >(() => new UserStore <ApplicationUser>(new ApplicationDbContext()), Lifestyle.Scoped);
            container.Register <IRoleStore <IdentityRole, string> >(() => new RoleStore <IdentityRole>(), Lifestyle.Scoped);
            container.Register <IAuthenticationManager>(() => AdvancedExtensions.IsVerifying(container)
                    ? new OwinContext(new Dictionary <string, object>()).Authentication
                    : HttpContext.Current.GetOwinContext().Authentication, Lifestyle.Scoped);

            container.Register <ApplicationUserManager>(Lifestyle.Scoped);
            container.Register <ApplicationSignInManager>(Lifestyle.Scoped);
        }