public IActionResult DeleteConfirmed(long id) { var user = _userRepository.Get(id); _userRepository.Delete(user); _userRepository.SaveChanges(); return(RedirectToAction(nameof(Index))); }
public void DeleteUser(long id) { UserProfile userProfile = _userProfileRepository.Get(id); User user = _userRepository.Get(id); _userProfileRepository.Delete(userProfile); _userRepository.Delete(user); _userRepository.SaveChanges(); }