Example #1
0
 public UserController(MoatGateIdentityDbContext context, UserManager <MoatGateIdentityUser> manager)
 {
     _context     = context;
     _userManager = manager;
 }
Example #2
0
 public RoleController(MoatGateIdentityDbContext context, RoleManager <MoatGateIdentityRole> manager)
 {
     _context = context;
     _manager = manager;
 }
Example #3
0
 public ListModel(MoatGateIdentityDbContext context, RoleManager <MoatGateIdentityRole> manager)
 {
     _context = context;
     _manager = manager;
 }
Example #4
0
        public async static Task Seed(UserManager <MoatGateIdentityUser> userManager, RoleManager <MoatGateIdentityRole> roleManager, MoatGateIdentityDbContext context)
        {
            if (!context.Roles.Any())
            {
                await roleManager.CreateAsync(new MoatGateIdentityRole()
                {
                    Name = "IdentityAdmin"
                });
            }

            if (!context.Users.Any())
            {
                var user = new MoatGateIdentityUser
                {
                    UserName      = "******",
                    Email         = "*****@*****.**",
                    SecurityStamp = Guid.NewGuid().ToString()
                };

                await userManager.CreateAsync(user, "10qp!)QP");

                await userManager.AddToRoleAsync(user, "IdentityAdmin");
            }
        }
Example #5
0
 public ListModel(MoatGateIdentityDbContext context)
 {
     _context = context;
 }