public virtual ApiMachineClientRequestModel MapClientResponseToRequest(
            ApiMachineClientResponseModel response)
        {
            var request = new ApiMachineClientRequestModel();

            request.SetProperties(
                response.Description,
                response.JwtKey,
                response.LastIpAddress,
                response.MachineGuid,
                response.Name);
            return(request);
        }
        public virtual ApiMachineClientResponseModel MapClientRequestToResponse(
            int id,
            ApiMachineClientRequestModel request)
        {
            var response = new ApiMachineClientResponseModel();

            response.SetProperties(id,
                                   request.Description,
                                   request.JwtKey,
                                   request.LastIpAddress,
                                   request.MachineGuid,
                                   request.Name);
            return(response);
        }
Пример #3
0
        public virtual async Task <UpdateResponse <ApiMachineClientResponseModel> > MachineUpdateAsync(int id, ApiMachineClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/Machines/{id}", item, cancellationToken).ConfigureAwait(false);

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