예제 #1
0
        public JsonPatchDocument <ApiVProductAndDescriptionRequestModel> CreatePatch(ApiVProductAndDescriptionRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiVProductAndDescriptionRequestModel>();

            patch.Replace(x => x.Description, model.Description);
            patch.Replace(x => x.Name, model.Name);
            patch.Replace(x => x.ProductID, model.ProductID);
            patch.Replace(x => x.ProductModel, model.ProductModel);
            return(patch);
        }
예제 #2
0
        public virtual ApiVProductAndDescriptionRequestModel MapResponseToRequest(
            ApiVProductAndDescriptionResponseModel response)
        {
            var request = new ApiVProductAndDescriptionRequestModel();

            request.SetProperties(
                response.Description,
                response.Name,
                response.ProductID,
                response.ProductModel);
            return(request);
        }
예제 #3
0
        public virtual ApiVProductAndDescriptionResponseModel MapRequestToResponse(
            string cultureID,
            ApiVProductAndDescriptionRequestModel request)
        {
            var response = new ApiVProductAndDescriptionResponseModel();

            response.SetProperties(cultureID,
                                   request.Description,
                                   request.Name,
                                   request.ProductID,
                                   request.ProductModel);
            return(response);
        }