Esempio n. 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);
        }
Esempio n. 2
0
        public virtual ApiVProductAndDescriptionRequestModel MapResponseToRequest(
            ApiVProductAndDescriptionResponseModel response)
        {
            var request = new ApiVProductAndDescriptionRequestModel();

            request.SetProperties(
                response.Description,
                response.Name,
                response.ProductID,
                response.ProductModel);
            return(request);
        }
Esempio n. 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);
        }