コード例 #1
0
        public JsonPatchDocument <ApiWorkerTaskLeaseRequestModel> CreatePatch(ApiWorkerTaskLeaseRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiWorkerTaskLeaseRequestModel>();

            patch.Replace(x => x.Exclusive, model.Exclusive);
            patch.Replace(x => x.JSON, model.JSON);
            patch.Replace(x => x.Name, model.Name);
            patch.Replace(x => x.TaskId, model.TaskId);
            patch.Replace(x => x.WorkerId, model.WorkerId);
            return(patch);
        }
コード例 #2
0
        public virtual ApiWorkerTaskLeaseRequestModel MapResponseToRequest(
            ApiWorkerTaskLeaseResponseModel response)
        {
            var request = new ApiWorkerTaskLeaseRequestModel();

            request.SetProperties(
                response.Exclusive,
                response.JSON,
                response.Name,
                response.TaskId,
                response.WorkerId);
            return(request);
        }
コード例 #3
0
        public virtual ApiWorkerTaskLeaseResponseModel MapRequestToResponse(
            string id,
            ApiWorkerTaskLeaseRequestModel request)
        {
            var response = new ApiWorkerTaskLeaseResponseModel();

            response.SetProperties(id,
                                   request.Exclusive,
                                   request.JSON,
                                   request.Name,
                                   request.TaskId,
                                   request.WorkerId);
            return(response);
        }