public async Task <UserModel> Register(UserRegisterModel userRegisterModel)
        {
            var user = await _userRepository.GetByUsername(userRegisterModel.UserName);

            if (user != null)
            {
                return(null);
            }

            var newUser = new User(
                userRegisterModel.UserName,
                userRegisterModel.Email,
                _passwordHasher.CreateHash(userRegisterModel.Password),
                userRegisterModel.Role,
                userRegisterModel.FirstName,
                userRegisterModel.LastName,
                userRegisterModel.PhoneNumber);

            newUser.UpdateAddress(userRegisterModel.Address);
            await _userRepository.Add(newUser);

            if (userRegisterModel.Role == Role.Student)
            {
                await _studentService.AddStudentToFaculty(userRegisterModel.UniversityId, userRegisterModel.FacultyId, newUser.Id);
            }

            await _userRepository.SaveChanges();

            return(_mapper.Map <UserModel>(newUser));
        }