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

            patch.Replace(x => x.FirstName, model.FirstName);
            patch.Replace(x => x.IsSalesPerson, model.IsSalesPerson);
            patch.Replace(x => x.IsShipper, model.IsShipper);
            patch.Replace(x => x.LastName, model.LastName);
            return(patch);
        }
コード例 #2
0
        public virtual ApiEmployeeRequestModel MapResponseToRequest(
            ApiEmployeeResponseModel response)
        {
            var request = new ApiEmployeeRequestModel();

            request.SetProperties(
                response.FirstName,
                response.IsSalesPerson,
                response.IsShipper,
                response.LastName);
            return(request);
        }
コード例 #3
0
        public virtual ApiEmployeeResponseModel MapRequestToResponse(
            int id,
            ApiEmployeeRequestModel request)
        {
            var response = new ApiEmployeeResponseModel();

            response.SetProperties(id,
                                   request.FirstName,
                                   request.IsSalesPerson,
                                   request.IsShipper,
                                   request.LastName);
            return(response);
        }