public virtual ApiProductClientRequestModel MapClientResponseToRequest( ApiProductClientResponseModel response) { var request = new ApiProductClientRequestModel(); request.SetProperties( response.Active, response.Description, response.Name, response.Price, response.Quantity); return(request); }
public virtual ApiProductClientResponseModel MapClientRequestToResponse( int id, ApiProductClientRequestModel request) { var response = new ApiProductClientResponseModel(); response.SetProperties(id, request.Active, request.Description, request.Name, request.Price, request.Quantity); return(response); }
public virtual async Task <UpdateResponse <ApiProductClientResponseModel> > ProductUpdateAsync(int id, ApiProductClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken)) { HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/Products/{id}", item, cancellationToken).ConfigureAwait(false); this.HandleResponseCode(httpResponse); return(JsonConvert.DeserializeObject <UpdateResponse <ApiProductClientResponseModel> >(httpResponse.Content.ContentToString())); }