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

            request.SetProperties(
                response.DateOfLastPing,
                response.IsActive,
                response.Name,
                response.PublicId);
            return(request);
        }
コード例 #2
0
        public virtual ApiDeviceClientResponseModel MapClientRequestToResponse(
            int id,
            ApiDeviceClientRequestModel request)
        {
            var response = new ApiDeviceClientResponseModel();

            response.SetProperties(id,
                                   request.DateOfLastPing,
                                   request.IsActive,
                                   request.Name,
                                   request.PublicId);
            return(response);
        }
コード例 #3
0
ファイル: ApiClient.cs プロジェクト: codenesium/samples
        public virtual async Task <UpdateResponse <ApiDeviceClientResponseModel> > DeviceUpdateAsync(int id, ApiDeviceClientRequestModel item, CancellationToken cancellationToken = default(CancellationToken))
        {
            HttpResponseMessage httpResponse = await this.Client.PutAsJsonAsync($"api/Devices/{id}", item, cancellationToken).ConfigureAwait(false);

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