예제 #1
0
        public IActionResult DeleteConfirmed(long id)
        {
            var user = _userRepository.Get(id);

            _userRepository.Delete(user);
            _userRepository.SaveChanges();
            return(RedirectToAction(nameof(Index)));
        }
예제 #2
0
        public void DeleteUser(long id)
        {
            UserProfile userProfile = _userProfileRepository.Get(id);
            User        user        = _userRepository.Get(id);

            _userProfileRepository.Delete(userProfile);
            _userRepository.Delete(user);

            _userRepository.SaveChanges();
        }