Beispiel #1
0
        public async Task <ActionResult> DeleteUser(string id, DeleteModel model)
        {
            if (ModelState.IsValid)
            {
                var user = GetUserOrThrow(id);
                await _userManager.DeleteAsync(user);

                return(this.RedirectToAction(x => x.ListUsers()));
            }

            return(View(nameof(DeleteUser), model));
        }
Beispiel #2
0
        public ActionResult DeleteUser(string id)
        {
            var user  = GetUserOrThrow(id);
            var model = new DeleteModel
            {
                Id        = user.Id,
                FirstName = user.FirstName,
                LastName  = user.LastName
            };

            return(View(nameof(DeleteUser), model));
        }