private bool IsValidUser(AuthorizationModel model)
        {
            var user = _userRepository.GetByUsername(model.Username);

            return
                (model.Username == user.Username &&
                 _hashHelper.GetHashAsString(model.Password) == user.Password);
        }
        public void Register(RegisterModel model)
        {
            var newUser = new User
            {
                Username = model.Username,
                Password = _hashHelper.GetHashAsString(model.Password),
                Email    = model.Email
            };

            _userRepository.AddUser(newUser);
        }