Пример #1
0
        public JsonPatchDocument <ApiDocumentRequestModel> CreatePatch(ApiDocumentRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiDocumentRequestModel>();

            patch.Replace(x => x.ChangeNumber, model.ChangeNumber);
            patch.Replace(x => x.Document1, model.Document1);
            patch.Replace(x => x.DocumentLevel, model.DocumentLevel);
            patch.Replace(x => x.DocumentSummary, model.DocumentSummary);
            patch.Replace(x => x.FileExtension, model.FileExtension);
            patch.Replace(x => x.FileName, model.FileName);
            patch.Replace(x => x.FolderFlag, model.FolderFlag);
            patch.Replace(x => x.ModifiedDate, model.ModifiedDate);
            patch.Replace(x => x.Owner, model.Owner);
            patch.Replace(x => x.Revision, model.Revision);
            patch.Replace(x => x.Status, model.Status);
            patch.Replace(x => x.Title, model.Title);
            return(patch);
        }
Пример #2
0
        public virtual ApiDocumentRequestModel MapResponseToRequest(
            ApiDocumentResponseModel response)
        {
            var request = new ApiDocumentRequestModel();

            request.SetProperties(
                response.ChangeNumber,
                response.Document1,
                response.DocumentLevel,
                response.DocumentSummary,
                response.FileExtension,
                response.FileName,
                response.FolderFlag,
                response.ModifiedDate,
                response.Owner,
                response.Revision,
                response.Status,
                response.Title);
            return(request);
        }