public virtual ApiDeviceActionClientRequestModel MapClientResponseToRequest(
            ApiDeviceActionClientResponseModel response)
        {
            var request = new ApiDeviceActionClientRequestModel();

            request.SetProperties(
                response.Action,
                response.DeviceId,
                response.Name);
            return(request);
        }
        public virtual ApiDeviceActionClientResponseModel MapClientRequestToResponse(
            int id,
            ApiDeviceActionClientRequestModel request)
        {
            var response = new ApiDeviceActionClientResponseModel();

            response.SetProperties(id,
                                   request.Action,
                                   request.DeviceId,
                                   request.Name);
            return(response);
        }
Beispiel #3
0
        public virtual async Task <UpdateResponse <ApiDeviceActionClientResponseModel> > DeviceActionUpdateAsync(int id, ApiDeviceActionClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/DeviceActions/{id}", item, cancellationToken).ConfigureAwait(false);

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