Example #1
0
        public async Task <ContentResult> AddAdminRole()
        {
            var user   = _userService.GetUserInfoByUserName("Admin");
            var result = await _roleManager.CreateAsync(new IdentityRole { Id = "Admin", Name = "Admin" });

            var roleResult = await _userManager.AddToRoleAsync(user, "Admin");

            return(Content("Successfull ${result}"));
        }