Ejemplo n.º 1
0
        public async Task <IActionResult> Index()
        {
            var user = await _rcmUserManager.GetUserAsync(_httpContextAccessor.HttpContext.User);

            var viewModel = new ManageViewModel()
            {
                ConfirmedEmail     = await _rcmUserManager.IsEmailConfirmedAsync(user),
                TwoFactorActivated = await _rcmUserManager.GetTwoFactorEnabledAsync(user),
                Roles = await _rcmUserManager.GetRolesAsync(user)
            };

            return(View(viewModel));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Index()
        {
            var currentUser = await _rcmUserManager.GetUserAsync(_httpContextAccessor.HttpContext.User);

            var users = new List <UserViewModel>();

            foreach (var user in _rcmUserManager.Users)
            {
                if (user == currentUser)
                {
                    continue;
                }

                users.Add(new UserViewModel()
                {
                    User  = user,
                    Roles = (List <string>) await _rcmUserManager.GetRolesAsync(user)
                });
            }

            return(View(users));
        }