示例#1
0
        public async Task <IActionResult> Get()
        {
            var users = (await _repo.GetUsersAsync()).Where(u => u.UserName != User.Identity.Name); // Don't include the current user
            var vms   = _mapper.Map <IEnumerable <CodeCampUserViewModel> >(users);

            for (var x = 0; x < users.Count(); ++x)
            {
                var element = vms.ElementAt(x);
                var usr     = users.ElementAt(x);
                element.IsAdmin = await _userMgr.IsInRoleAsync(usr, Consts.ADMINROLE);

                element.IsEmailConfirmed = usr.EmailConfirmed;
            }

            return(Ok(vms));
        }