Example #1
0
        public UserDetailDTO UpdateUser(int userId, UserViewModel updatedUser)
        {
            if (_repo.getUserById(userId) == null)
            {
                throw new UserNotFoundException();
            }
            var user = new User
            {
                UserId    = userId,
                FirstName = updatedUser.FirstName,
                LastName  = updatedUser.LastName,
                Email     = updatedUser.Email,
                Address   = updatedUser.Address
            };

            var result = _repo.UpdateUser(userId, user);

            if (result == null)
            {
                throw new UserNotFoundException();
            }
            return(GetUserById(result.UserId));
        }
Example #2
0
 public User UpdateUser(User obj)
 {
     return(_UsersRepository.UpdateUser(obj));
 }