public virtual ApiCustomerClientRequestModel MapClientResponseToRequest(
            ApiCustomerClientResponseModel response)
        {
            var request = new ApiCustomerClientRequestModel();

            request.SetProperties(
                response.Email,
                response.FirstName,
                response.LastName,
                response.Phone);
            return(request);
        }
        public virtual ApiCustomerClientResponseModel MapClientRequestToResponse(
            int id,
            ApiCustomerClientRequestModel request)
        {
            var response = new ApiCustomerClientResponseModel();

            response.SetProperties(id,
                                   request.Email,
                                   request.FirstName,
                                   request.LastName,
                                   request.Phone);
            return(response);
        }
Example #3
0
        public virtual async Task <UpdateResponse <ApiCustomerClientResponseModel> > CustomerUpdateAsync(int id, ApiCustomerClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/Customers/{id}", item, cancellationToken).ConfigureAwait(false);

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