public RedirectToRouteResult DeleteUser(Guid id)
{
_userService.Delete(_userService.Get(id));
return RedirectToAction("Index");
}
Only the membership part of the user is deleted. The user itself remains. It's not so much of an issue in the rest of the application except for the view displaying all the users for a specific role :
public ViewResult Role(string id)
{
return View(new RoleViewModel
{
Role = id,
Users = _rolesService.FindUserNamesByRole(id).Select(username => _userService.Get(username))
});
}
It will pop a null reference as the user will still exist in the list return by _rolesService.FindUserNamesByRole(id) but not by _userService.Get(username) which leads to this version where it is tested :
When you delete a user through this method :
Only the membership part of the user is deleted. The user itself remains. It's not so much of an issue in the rest of the application except for the view displaying all the users for a specific role :
It will pop a null reference as the user will still exist in the list return by _rolesService.FindUserNamesByRole(id) but not by _userService.Get(username) which leads to this version where it is tested :