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

            patch.Replace(x => x.Name, model.Name);
            return(patch);
        }
コード例 #2
0
        public virtual ApiSpeciesRequestModel MapResponseToRequest(
            ApiSpeciesResponseModel response)
        {
            var request = new ApiSpeciesRequestModel();

            request.SetProperties(
                response.Name);
            return(request);
        }
コード例 #3
0
        public virtual ApiSpeciesResponseModel MapRequestToResponse(
            int id,
            ApiSpeciesRequestModel request)
        {
            var response = new ApiSpeciesResponseModel();

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