コード例 #1
0
        public virtual ApiProductClientRequestModel MapClientResponseToRequest(
            ApiProductClientResponseModel response)
        {
            var request = new ApiProductClientRequestModel();

            request.SetProperties(
                response.Active,
                response.Description,
                response.Name,
                response.Price,
                response.Quantity);
            return(request);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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()));
        }