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

            patch.Replace(x => x.BountyAmount, model.BountyAmount);
            patch.Replace(x => x.CreationDate, model.CreationDate);
            patch.Replace(x => x.PostId, model.PostId);
            patch.Replace(x => x.UserId, model.UserId);
            patch.Replace(x => x.VoteTypeId, model.VoteTypeId);
            return(patch);
        }
コード例 #2
0
        public virtual ApiVotesRequestModel MapResponseToRequest(
            ApiVotesResponseModel response)
        {
            var request = new ApiVotesRequestModel();

            request.SetProperties(
                response.BountyAmount,
                response.CreationDate,
                response.PostId,
                response.UserId,
                response.VoteTypeId);
            return(request);
        }
コード例 #3
0
        public virtual ApiVotesResponseModel MapRequestToResponse(
            int id,
            ApiVotesRequestModel request)
        {
            var response = new ApiVotesResponseModel();

            response.SetProperties(id,
                                   request.BountyAmount,
                                   request.CreationDate,
                                   request.PostId,
                                   request.UserId,
                                   request.VoteTypeId);
            return(response);
        }