Пример #1
0
        public IHttpActionResult ChangePersonalInfo(ChangePersonalInfoRequest request)
        {
            var player = _queries.GetPlayer(request.PlayerId);

            if (player == null)
            {
                throw new RegoValidationException(ErrorMessagesEnum.PlayerWithRequestedIdDoesntExist.ToString());
            }

            var playerData = Mapper.Map <EditPlayerData>(player);
            var newData    = Mapper.Map <EditPlayerData>(request);

            playerData.PlayerId          = request.PlayerId;
            playerData.Title             = newData.Title;
            playerData.FirstName         = newData.FirstName;
            playerData.LastName          = newData.LastName;
            playerData.Email             = newData.Email;
            playerData.DateOfBirth       = newData.DateOfBirth;
            playerData.Gender            = newData.Gender;
            playerData.CurrencyCode      = newData.CurrencyCode;
            playerData.AccountAlertEmail = newData.AccountAlertEmail;
            playerData.AccountAlertSms   = newData.AccountAlertSms;
            _commands.Edit(playerData);

            var uri = UriRootToProfileInfo + playerData.PlayerId;

            return(Created(uri, new ChangePersonalInfoResponse()
            {
                UriToUserWithPersonalInfoUpdated = uri
            }));
        }
Пример #2
0
 public async Task <ChangePersonalInfoResponse> ChangePersonalInfo(ChangePersonalInfoRequest request)
 {
     return(await _memberApiProxy.ChangePersonalInfoAsync(request));
 }
Пример #3
0
        public async Task <ChangePersonalInfoResponse> ChangePersonalInfoAsync(ChangePersonalInfoRequest request)
        {
            var result = await HttpClient.SecurePostAsJsonAsync(Token, "api/Player/ChangePersonalInfo", request);

            return(await EnsureApiResult <ChangePersonalInfoResponse>(result));
        }