public virtual ApiBreedClientRequestModel MapClientResponseToRequest(
            ApiBreedClientResponseModel response)
        {
            var request = new ApiBreedClientRequestModel();

            request.SetProperties(
                response.Name,
                response.SpeciesId);
            return(request);
        }
        public virtual ApiBreedClientResponseModel MapClientRequestToResponse(
            int id,
            ApiBreedClientRequestModel request)
        {
            var response = new ApiBreedClientResponseModel();

            response.SetProperties(id,
                                   request.Name,
                                   request.SpeciesId);
            return(response);
        }
Esempio n. 3
0
        public virtual async Task <UpdateResponse <ApiBreedClientResponseModel> > BreedUpdateAsync(int id, ApiBreedClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/Breeds/{id}", item, cancellationToken).ConfigureAwait(false);

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