} // IsExistById

/*
 *      public IsExistByGuidResponse IsExistByGuid(IsExistByGuidRequest request)
 *      {
 *
 *          IsExistByGuidResponse response = new IsExistByGuidResponse();
 *
 *          try
 *          {
 *
 *              if (new AuthenticationRequestCap().IsExistByGuid(request.Guid))
 *                  response.Result = new Ac4yProcessResult() { Code = Ac4yProcessResult.SUCCESS };
 *              else
 *                  response.Result = new Ac4yProcessResult() { Code = Ac4yProcessResult.INEFFECTIVE };
 *
 *          }
 *          catch (Exception exception)
 *          {
 *              response.Result = (new Ac4yProcessResult() { Code = Ac4yProcessResult.FAIL, Message = exception.Message, Description = exception.StackTrace });
 *          }
 *
 *          return response;
 *
 *      } // IsExistByGuid
 */
        public UpdateByIdResponse UpdateById(UpdateByIdRequest request)
        {
            UpdateByIdResponse response = new UpdateByIdResponse();

            try
            {
                if (new AuthenticationRequestCap().IsExistById(request.Id))
                {
                    AuthenticationRequest responseAuthenticationRequest = new AuthenticationRequestCap().UpdateById(request.Id, request.AuthenticationRequest);

                    response.Result = new Ac4yProcessResult()
                    {
                        Code = Ac4yProcessResult.SUCCESS
                    };
                    response.AuthenticationRequest = responseAuthenticationRequest;
                }
                else
                {
                    response.Result = new Ac4yProcessResult()
                    {
                        Code = Ac4yProcessResult.FAIL, Message = "Adott id-val nem létezik rekord."
                    };
                }
            }
            catch (Exception exception)
            {
                response.Result = (new Ac4yProcessResult()
                {
                    Code = Ac4yProcessResult.FAIL, Message = exception.Message, Description = exception.StackTrace
                });
            }

            return(response);
        } // UpdateById
        public async Task Handle_UpdateByIdRequest_UpdatesUser()
        {
            var request = new UpdateByIdRequest <User, UserDto, UserGetDto>(
                _user.Id,
                new UserDto {
                Name = "NewUser"
            });

            var response = await Mediator.HandleAsync(request);

            Assert.IsFalse(response.HasErrors);
            Assert.IsNotNull(response.Data);
            Assert.AreEqual(_user.Id, response.Data.Id);
            Assert.AreEqual("NewUser", response.Data.Name);
        }
 public UpdateByIdResponse UpdateById(UpdateByIdRequest request)
 {
     return new Ac4yPersistentChildEFService().UpdateById(request);
 }