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

            patch.Replace(x => x.AmountPerMinute, model.AmountPerMinute);
            patch.Replace(x => x.TeacherId, model.TeacherId);
            patch.Replace(x => x.TeacherSkillId, model.TeacherSkillId);
            return(patch);
        }
コード例 #2
0
        public virtual ApiRateRequestModel MapResponseToRequest(
            ApiRateResponseModel response)
        {
            var request = new ApiRateRequestModel();

            request.SetProperties(
                response.AmountPerMinute,
                response.TeacherId,
                response.TeacherSkillId);
            return(request);
        }
コード例 #3
0
        public virtual ApiRateResponseModel MapRequestToResponse(
            int id,
            ApiRateRequestModel request)
        {
            var response = new ApiRateResponseModel();

            response.SetProperties(id,
                                   request.AmountPerMinute,
                                   request.TeacherId,
                                   request.TeacherSkillId);
            return(response);
        }