public static StoreUserManager Create(IdentityFactoryOptions <StoreUserManager> options, IOwinContext context)
        {
            var dbContext = context.Get <StoreIdentityDbContext>();
            var manager   = new StoreUserManager(new UserStore <StoreUser>(dbContext));

            return(manager);
        }
        protected override void Seed(StoreIdentityDbContext context)
        {
            var userMgr = new StoreUserManager(new UserStore <StoreUser>(context));
            var roleMgr = new StoreRoleManager(new RoleStore <StoreRole>(context));

            string roleName = "Administrators";
            string userName = "******";
            string password = "******";
            string email    = "*****@*****.**";

            if (!roleMgr.RoleExists(roleName))
            {
                roleMgr.Create(new StoreRole(roleName));
            }

            StoreUser user = userMgr.FindByName(userName);

            if (user == null)
            {
                userMgr.Create(new StoreUser
                {
                    UserName = userName,
                    Email    = email
                }, password);
                user = userMgr.FindByName(userName);
            }

            if (!userMgr.IsInRole(user.Id, roleName))
            {
                userMgr.AddToRole(user.Id, roleName);
            }
            base.Seed(context);
        }