Example #1
0
        public JsonPatchDocument <ApiPetRequestModel> CreatePatch(ApiPetRequestModel model)
        {
            var patch = new JsonPatchDocument <ApiPetRequestModel>();

            patch.Replace(x => x.AcquiredDate, model.AcquiredDate);
            patch.Replace(x => x.BreedId, model.BreedId);
            patch.Replace(x => x.Description, model.Description);
            patch.Replace(x => x.PenId, model.PenId);
            patch.Replace(x => x.Price, model.Price);
            patch.Replace(x => x.SpeciesId, model.SpeciesId);
            return(patch);
        }
Example #2
0
        public virtual ApiPetRequestModel MapResponseToRequest(
            ApiPetResponseModel response)
        {
            var request = new ApiPetRequestModel();

            request.SetProperties(
                response.AcquiredDate,
                response.BreedId,
                response.Description,
                response.PenId,
                response.Price,
                response.SpeciesId);
            return(request);
        }