예제 #1
0
        public JsonPatchDocument <ApiDeviceActionRequestModel> CreatePatch(ApiDeviceActionRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiDeviceActionRequestModel>();

            patch.Replace(x => x.DeviceId, model.DeviceId);
            patch.Replace(x => x.Name, model.Name);
            patch.Replace(x => x.@Value, model.@Value);
            return(patch);
        }
예제 #2
0
        public virtual ApiDeviceActionRequestModel MapResponseToRequest(
            ApiDeviceActionResponseModel response)
        {
            var request = new ApiDeviceActionRequestModel();

            request.SetProperties(
                response.DeviceId,
                response.Name,
                response.@Value);
            return(request);
        }
예제 #3
0
        public virtual ApiDeviceActionResponseModel MapRequestToResponse(
            int id,
            ApiDeviceActionRequestModel request)
        {
            var response = new ApiDeviceActionResponseModel();

            response.SetProperties(id,
                                   request.DeviceId,
                                   request.Name,
                                   request.@Value);
            return(response);
        }