/// <summary>
        /// </summary>
        public RegistrationResponse RegisterNewUser(ISession session, RegistrationRequest request)
        {
            var response = request.CreateResponse(new RegistrationResponse { Result = RegistrationResponseType.Success });
            User user = null;
            
            try
            {
                user = new User(request.Name, request.Password, request.Huid, request.Sex, request.Age, request.PushUri, request.Country, request.Platform);
            }
            catch (InvalidUserRegistrationDataException)
            {
                response.Result = RegistrationResponseType.InvalidData;
                return response;
            }

            using (var uow = UnitOfWorkFactory.Create())
            {
                if (uow.UsersRepository.AnyMatching(UserSpecification.Name(user.Name)))
                {
                    response.Result = RegistrationResponseType.NameIsInUse;
                    return response;
                }

                uow.UsersRepository.Add(user);
                uow.Commit();
            }
            response.User = user.ProjectedAs<UserDto>();
            session.SetUser(user);
            return response;
        }
 public Task<RegistrationResponse> RegisterNewUser(RegistrationRequest request)
 {
     return ConnectionManager.SendRequestAndWaitResponse<RegistrationResponse>(request);
 }