コード例 #1
0
        public async Task <IActionResult> Edit(ListApplicationUserViewModel userViewModel)
        {
            string id      = userViewModel.UserId.ToString();
            var    appUser = await userManager.FindByIdAsync(id);

            appUser.UserName = userViewModel.UserName;
            appUser.Email    = userViewModel.Email;
            await userManager.UpdateAsync(appUser);

            return(RedirectToAction("Index"));
        }
コード例 #2
0
        public async Task <IActionResult> Delete(Guid id)
        {
            string uid  = id.ToString();
            var    user = await userManager.FindByIdAsync(uid);

            ListApplicationUserViewModel appUserViewModel = new ListApplicationUserViewModel()
            {
                UserId   = user.Id,
                UserName = user.UserName,
                Email    = user.Email
            };

            return(View(appUserViewModel));
        }
コード例 #3
0
        public async Task <IActionResult> Edit(Guid id)
        {
            string uid  = id.ToString();
            var    user = await userManager.FindByIdAsync(uid);

            ListApplicationUserViewModel appUserViewModel = new ListApplicationUserViewModel()
            {
                UserId   = user.Id,
                UserName = user.UserName,
                Email    = user.Email
                           //isAdmin = if (role==admin)-> true admin jogot lehessen adni valakinek?
            };

            return(View(appUserViewModel));
        }