示例#1
0
        public virtual ApiSaleClientRequestModel MapClientResponseToRequest(
            ApiSaleClientResponseModel response)
        {
            var request = new ApiSaleClientRequestModel();

            request.SetProperties(
                response.CustomerId,
                response.Date);
            return(request);
        }
示例#2
0
        public virtual ApiSaleClientResponseModel MapClientRequestToResponse(
            int id,
            ApiSaleClientRequestModel request)
        {
            var response = new ApiSaleClientResponseModel();

            response.SetProperties(id,
                                   request.CustomerId,
                                   request.Date);
            return(response);
        }
示例#3
0
        public virtual async Task <UpdateResponse <ApiSaleClientResponseModel> > SaleUpdateAsync(int id, ApiSaleClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/Sales/{id}", item, cancellationToken).ConfigureAwait(false);

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