Пример #1
0
        public virtual ApiSaleClientRequestModel MapClientResponseToRequest(
            ApiSaleClientResponseModel response)
        {
            var request = new ApiSaleClientRequestModel();

            request.SetProperties(
                response.Amount,
                response.FirstName,
                response.LastName,
                response.PaymentTypeId,
                response.PetId,
                response.Phone);
            return(request);
        }
Пример #2
0
        public virtual ApiSaleClientResponseModel MapClientRequestToResponse(
            int id,
            ApiSaleClientRequestModel request)
        {
            var response = new ApiSaleClientResponseModel();

            response.SetProperties(id,
                                   request.Amount,
                                   request.FirstName,
                                   request.LastName,
                                   request.PaymentTypeId,
                                   request.PetId,
                                   request.Phone);
            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()));
        }