public virtual ApiPetClientRequestModel MapClientResponseToRequest(
            ApiPetClientResponseModel response)
        {
            var request = new ApiPetClientRequestModel();

            request.SetProperties(
                response.AcquiredDate,
                response.BreedId,
                response.Description,
                response.PenId,
                response.Price);
            return(request);
        }
        public virtual ApiPetClientResponseModel MapClientRequestToResponse(
            int id,
            ApiPetClientRequestModel request)
        {
            var response = new ApiPetClientResponseModel();

            response.SetProperties(id,
                                   request.AcquiredDate,
                                   request.BreedId,
                                   request.Description,
                                   request.PenId,
                                   request.Price);
            return(response);
        }
Example #3
0
        public virtual async Task <UpdateResponse <ApiPetClientResponseModel> > PetUpdateAsync(int id, ApiPetClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/Pets/{id}", item, cancellationToken).ConfigureAwait(false);

            this.HandleResponseCode(httpResponse);
            return(JsonConvert.DeserializeObject <UpdateResponse <ApiPetClientResponseModel> >(httpResponse.Content.ContentToString()));
        }