Exemplo n.º 1
0
        public static void Initialize(AstroPodDbContext context)
        {
            if (context.Roles.Any())
            {
                return;
            }


            var roles = new IdentityRole[]
            {
                new IdentityRole()
                {
                    Name = "Admin"
                }
            };

            var content = new Content[]
            {
            };


            foreach (var r in roles)
            {
                context.Roles.Add(r);
            }

            foreach (var r in roles)
            {
                context.Roles.Add(r);
            }



            context.SaveChanges();
        }
Exemplo n.º 2
0
 public MoonController(UserManager <AppUser> userManager, SignInManager <AppUser> signInManager, AstroPodDbContext db)
 {
     _userManager   = userManager;
     _signInManager = signInManager;
     _db            = db;
 }