コード例 #1
0
        public virtual ApiDeviceActionClientRequestModel MapClientResponseToRequest(
            ApiDeviceActionClientResponseModel response)
        {
            var request = new ApiDeviceActionClientRequestModel();

            request.SetProperties(
                response.Action,
                response.DeviceId,
                response.Name);
            return(request);
        }
コード例 #2
0
        public virtual ApiDeviceActionClientResponseModel MapClientRequestToResponse(
            int id,
            ApiDeviceActionClientRequestModel request)
        {
            var response = new ApiDeviceActionClientResponseModel();

            response.SetProperties(id,
                                   request.Action,
                                   request.DeviceId,
                                   request.Name);
            return(response);
        }
コード例 #3
0
ファイル: ApiClient.cs プロジェクト: codenesium/samples
        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()));
        }