public JsonPatchDocument <ApiPostHistoryRequestModel> CreatePatch(ApiPostHistoryRequestModel model) { var patch = new JsonPatchDocument <ApiPostHistoryRequestModel>(); patch.Replace(x => x.Comment, model.Comment); patch.Replace(x => x.CreationDate, model.CreationDate); patch.Replace(x => x.PostHistoryTypeId, model.PostHistoryTypeId); patch.Replace(x => x.PostId, model.PostId); patch.Replace(x => x.RevisionGUID, model.RevisionGUID); patch.Replace(x => x.Text, model.Text); patch.Replace(x => x.UserDisplayName, model.UserDisplayName); patch.Replace(x => x.UserId, model.UserId); return(patch); }
public virtual ApiPostHistoryRequestModel MapResponseToRequest( ApiPostHistoryResponseModel response) { var request = new ApiPostHistoryRequestModel(); request.SetProperties( response.Comment, response.CreationDate, response.PostHistoryTypeId, response.PostId, response.RevisionGUID, response.Text, response.UserDisplayName, response.UserId); return(request); }